summaryrefslogtreecommitdiff
path: root/emfio
AgeCommit message (Collapse)Author
2019-11-23emfio: extra loggingChris Sherlock
For emfio I believe we need more logging, so I am gradually adding this. I decided to log the EMR_COMMENT_PUBLIC record subtypes EMR_COMMENT_BEGINGROUP and EMR_COMMENT_ENDGROUP. I honestly don't know what these actually do, but they are specified in [MS-EMF] 2.3.3.4.1 and 2.3.3.4.2. Later on, we will need to look into handling EMR_COMMENT_MULTIFORMATS so we can display things with EPS data. We should also probably look into handling EMR_COMMENT_WINDOWS_METAFILE later on also. Change-Id: I7c3ba3cfd7f51a6cff2c7a47a48dde12240d0382 Reviewed-on: https://gerrit.libreoffice.org/83407 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2019-11-22Extend loplugin:external to warn about classesStephan Bergmann
...following up on 314f15bff08b76bf96acf99141776ef64d2f1355 "Extend loplugin:external to warn about enums". Cases where free functions were moved into an unnamed namespace along with a class, to not break ADL, are in: filter/source/svg/svgexport.cxx sc/source/filter/excel/xelink.cxx sc/source/filter/excel/xilink.cxx svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx All other free functions mentioning moved classes appear to be harmless and not give rise to (silent, even) ADL breakage. (One remaining TODO in compilerplugins/clang/external.cxx is that derived classes are not covered by computeAffectedTypes, even though they could also be affected by ADL-breakage--- but don't seem to be in any acutal case across the code base.) For friend declarations using elaborate type specifiers, like class C1 {}; class C2 { friend class C1; }; * If C2 (but not C1) is moved into an unnamed namespace, the friend declaration must be changed to not use an elaborate type specifier (i.e., "friend C1;"; see C++17 [namespace.memdef]/3: "If the name in a friend declaration is neither qualified nor a template-id and the declaration is a function or an elaborated-type-specifier, the lookup to determine whether the entity has been previously declared shall not consider any scopes outside the innermost enclosing namespace.") * If C1 (but not C2) is moved into an unnamed namespace, the friend declaration must be changed too, see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71882> "elaborated-type-specifier friend not looked up in unnamed namespace". Apart from that, to keep changes simple and mostly mechanical (which should help avoid regressions), out-of-line definitions of class members have been left in the enclosing (named) namespace. But explicit specializations of class templates had to be moved into the unnamed namespace to appease <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92598> "explicit specialization of template from unnamed namespace using unqualified-id in enclosing namespace". Also, accompanying declarations (of e.g. typedefs or static variables) that could arguably be moved into the unnamed namespace too have been left alone. And in some cases, mention of affected types in blacklists in other loplugins needed to be adapted. And sc/qa/unit/mark_test.cxx uses a hack of including other .cxx, one of which is sc/source/core/data/segmenttree.cxx where e.g. ScFlatUInt16SegmentsImpl is not moved into an unnamed namespace (because it is declared in sc/inc/segmenttree.hxx), but its base ScFlatSegmentsImpl is. GCC warns about such combinations with enabled-by-default -Wsubobject-linkage, but "The compiler doesn’t give this warning for types defined in the main .C file, as those are unlikely to have multiple definitions." (<https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Warning-Options.html>) The warned-about classes also don't have multiple definitions in the given test, so disable the warning when including the .cxx. Change-Id: Ib694094c0d8168be68f8fe90dfd0acbb66a3f1e4 Reviewed-on: https://gerrit.libreoffice.org/83239 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-20emfio: add SAL_WARNs for unimplemented EMR_COMMENTsChris Sherlock
Change-Id: I449a0c2db77888a87a0ae983617848a9f0886ef1 Reviewed-on: https://gerrit.libreoffice.org/83233 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2019-11-19make some classes module-privateNoel Grandin
Change-Id: I53809ab01d5e8eb091305c3cb618a64920ad22ad Reviewed-on: https://gerrit.libreoffice.org/82783 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-18make bin/update_pch.s always include code in trivial #if'sLuboš Luňák
E.g. #ifdef LIBO_INTERNAL_ONLY is always true for code that builds with our PCHs. Change-Id: I3cf311ea3621b909105754cfea2cb0116b8b67f5 Reviewed-on: https://gerrit.libreoffice.org/80961 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-09-30ofz#17817 avoid OOMCaolán McNamara
Change-Id: I354edf5b169e797c76ec79719cdce01e63329df4 Reviewed-on: https://gerrit.libreoffice.org/79833 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-09-26loplugin:constmethod in embeddedobj..extensionsNoel Grandin
Change-Id: Iec6a9ff8b62ac1986cca205435273b64b71f33cd Reviewed-on: https://gerrit.libreoffice.org/79539 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-23do not require $(SRCDIR) in every gb_Library_set_precompiled_headerLuboš Luňák
Change-Id: I7b3a22584bb2e4d501f509ffcd80929feed23a4c Reviewed-on: https://gerrit.libreoffice.org/79360 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-08-12Fix typosAndrea Gelmini
Change-Id: I4bd004af206813b9dc01c50ab20f2e8b954b8dca Reviewed-on: https://gerrit.libreoffice.org/77323 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-07-31Improved loplugin:stringconstant (now that GCC 7 supports it): emfioStephan Bergmann
Change-Id: I8effe9e6e82340613016807490d1e727c02d1f6a Reviewed-on: https://gerrit.libreoffice.org/76680 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-07-05Enable many more unit tests on all archsJan-Marek Glogowski
This depends on commit "Make font-based unit test depend on instdir fonts, not that it's sure that this really fixes the problem, as its origin is really unknown. It especially enables all the font-based tests I could find on all archs. Same for many more test where I couldn't see any reason they don't work generally. To get rid of even more ifdefs, it moves these from the class to the functions, so there is actually just one needed for any test. As a result some few tests run but do nothing. There is still some problem with embedded fonts on MacOS and with delayed graphics loading on Windows, so these ifdefs are kept. Change-Id: I63f8424e9debda6cbf3e5777c93245e09f8eb0f2 Reviewed-on: https://gerrit.libreoffice.org/74719 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2019-07-04remove some unneede vcl/bitmap.hxx includesNoel Grandin
Change-Id: Ibdc79538276992193e61f6dc16ddd3fd1ab80b82 Reviewed-on: https://gerrit.libreoffice.org/75069 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-25improve loplugin:simplifyconstructNoel Grandin
Change-Id: If863d28c6db470faa0d22273020888d4219e069e Reviewed-on: https://gerrit.libreoffice.org/74559 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-06-22Resolves; ofz#15426 Integer-overflowCaolán McNamara
Change-Id: I43ac26058a98a85fc09321a93e29dbeb151f5069 Reviewed-on: https://gerrit.libreoffice.org/74572 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-06-04Avoid truncation of ±1E20 to longStephan Bergmann
With -fsanitize=float-cast-overflow, opening doc/abi5309-1.doc as obtained by bin/get-bugzilla-attachments-by-mimetype (i.e., the attachment at <https://bugzilla.abisource.com/show_bug.cgi?id=5309#c3>) fails with > include/tools/helpers.hxx:76:79: runtime error: 1e+20 is outside the range of representable values of type 'long' > #0 in FRound(double) at include/tools/helpers.hxx:76:79 (instdir/program/libtllo.so +0x3c13dd) > #1 in ImplPolygon::ImplPolygon(basegfx::B2DPolygon const&) at tools/source/generic/poly.cxx:474:30 (instdir/program/libtllo.so +0x40f35f) > #2 in tools::Polygon::Polygon(basegfx::B2DPolygon const&) at tools/source/generic/poly.cxx:1849:72 (instdir/program/libtllo.so +0x42c9ff) > #3 in ImplPolyPolygon::ImplPolyPolygon(basegfx::B2DPolyPolygon const&) at tools/source/generic/poly2.cxx:482:28 (instdir/program/libtllo.so +0x45561e) > #4 in tools::PolyPolygon::PolyPolygon(basegfx::B2DPolyPolygon const&) at tools/source/generic/poly2.cxx:463:25 (instdir/program/libtllo.so +0x45512d) > #5 in emfio::MtfTools::DrawPolygon(tools::Polygon, bool) at emfio/source/reader/mtftools.cxx:1287:17 (instdir/program/../program/libemfiolo.so +0x1828d3) > #6 in emfio::WmfReader::ReadRecordParams(unsigned short) at emfio/source/reader/wmfreader.cxx:367:21 (instdir/program/../program/libemfiolo.so +0x1cffde) > #7 in emfio::WmfReader::ReadWMF() at emfio/source/reader/wmfreader.cxx:1425:29 (instdir/program/../program/libemfiolo.so +0x1f7567) > #8 in emfio::emfreader::XEmfParser::getDecomposition(com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at emfio/source/emfuno/xemfparser.cxx:152:108 (instdir/program/../program/libemfiolo.so +0x13795a) > #9 in non-virtual thunk to emfio::emfreader::XEmfParser::getDecomposition(com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at emfio/source/emfuno/xemfparser.cxx (instdir/program/../program/libemfiolo.so +0x138735) > #10 in VectorGraphicData::ensureSequenceAndRange() at vcl/source/gdi/vectorgraphicdata.cxx:172:137 (instdir/program/libvcllo.so +0x86bdadf) > #11 in VectorGraphicData::ensureReplacement() at vcl/source/gdi/vectorgraphicdata.cxx:138:5 (instdir/program/libvcllo.so +0x86bcb94) > #12 in VectorGraphicData::getReplacement() const at vcl/source/gdi/vectorgraphicdata.cxx:286:45 (instdir/program/libvcllo.so +0x86c0a04) > #13 in ImpGraphic::ImplSetPrefSize(Size const&) at vcl/source/gdi/impgraph.cxx:956:45 (instdir/program/libvcllo.so +0x7d05433) > #14 in Graphic::SetPrefSize(Size const&) at vcl/source/gdi/graph.cxx:388:19 (instdir/program/libvcllo.so +0x7ca7e26) > #15 in SvxMSDffManager::GetBLIPDirect(SvStream&, Graphic&, tools::Rectangle*) at filter/source/msfilter/msdffimp.cxx:6616:26 (instdir/program/../program/libmsfilterlo.so +0x9617bc) > #16 in SvxMSDffManager::GetBLIP(unsigned long, Graphic&, tools::Rectangle*) at filter/source/msfilter/msdffimp.cxx:6453:23 (instdir/program/../program/libmsfilterlo.so +0x95f368) > #17 in SvxMSDffManager::ImportGraphic(SvStream&, SfxItemSet&, DffObjData const&) at filter/source/msfilter/msdffimp.cxx:3821:24 (instdir/program/../program/libmsfilterlo.so +0x990678) > #18 in SvxMSDffManager::ImportShape(DffRecordHeader const&, SvStream&, SvxMSDffClientData&, tools::Rectangle&, tools::Rectangle const&, int, int*) at filter/source/msfilter/msdffimp.cxx:4368:28 (instdir/program/../program/libmsfilterlo.so +0x9a221a) > #19 in SvxMSDffManager::ImportObj(SvStream&, SvxMSDffClientData&, tools::Rectangle&, tools::Rectangle const&, int, int*) at filter/source/msfilter/msdffimp.cxx:4073:16 (instdir/program/../program/libmsfilterlo.so +0x9972d8) > #20 in SvxMSDffManager::GetShape(unsigned long, SdrObject*&, SvxMSDffImportData&) at filter/source/msfilter/msdffimp.cxx:6377:23 (instdir/program/../program/libmsfilterlo.so +0x9dde0c) > #21 in SwWW8ImplReader::Read_GrafLayer(long) at sw/source/filter/ww8/ww8graf.cxx:2567:34 (instdir/program/../program/libmswordlo.so +0x2c51a1f) > #22 in SwWW8ImplReader::ReadChar(long, long) at sw/source/filter/ww8/ww8par.cxx:3697:17 (instdir/program/../program/libmswordlo.so +0x2db3a07) > #23 in SwWW8ImplReader::ReadChars(int&, int, long, long) at sw/source/filter/ww8/ww8par.cxx:3484:27 (instdir/program/../program/libmswordlo.so +0x2dafba2) > #24 in SwWW8ImplReader::ReadText(int, int, ManTypes) at sw/source/filter/ww8/ww8par.cxx:4045:22 (instdir/program/../program/libmswordlo.so +0x2d85c3e) > #25 in SwWW8ImplReader::CoreLoad(WW8Glossary const*) at sw/source/filter/ww8/ww8par.cxx:5227:9 (instdir/program/../program/libmswordlo.so +0x2de3314) > #26 in SwWW8ImplReader::LoadThroughDecryption(WW8Glossary*) at sw/source/filter/ww8/ww8par.cxx:5892:19 (instdir/program/../program/libmswordlo.so +0x2df31ad) > #27 in SwWW8ImplReader::LoadDoc(WW8Glossary*) at sw/source/filter/ww8/ww8par.cxx:6196:19 (instdir/program/../program/libmswordlo.so +0x2dfe1ed) > #28 in WW8Reader::Read(SwDoc&, rtl::OUString const&, SwPaM&, rtl::OUString const&) at sw/source/filter/ww8/ww8par.cxx:6347:26 (instdir/program/../program/libmswordlo.so +0x2e0301a) > #29 in SwReader::Read(Reader const&) at sw/source/filter/basflt/shellio.cxx:188:22 (instdir/program/../program/libswlo.so +0x1041d2be) > #30 in SwDocShell::ConvertFrom(SfxMedium&) at sw/source/uibase/app/docsh.cxx:261:26 (instdir/program/../program/libswlo.so +0x10fc4d98) > #31 in SfxObjectShell::DoLoad(SfxMedium*) at sfx2/source/doc/objstor.cxx:768:23 (instdir/program/libsfxlo.so +0x49d934a) [...] To represent "negative" clip regions, basegfx/source/tools/b2dclipstate.cxx uses an ugly hack of subtracting the region from a ±1E20 bounding box. This document uses such a negative clip region with a 4504x633@(11301,38) rectangular hole. (Though I don't know whether that's the real intention, or caused by LO misparsing the input file format.) So to avoid converting the ±1E20 bounding box from double to long, do the intersection here with basegfx double values, and only convert the result to tools long values. (There appears to be no implemenation of intersection with a polypolygon for B2DPolyPolyon, just B2DClipState::intersectPolyPolygon.) (In principle there could be loss of precision when aPolyPoly is converted to a B2DPolyPolygon now, but that's unlikely with a typical IEEE 754 double with 52 bit mantissa.) Change-Id: I82a9941b43d90153d63612147b2ca33fbca5f179 Reviewed-on: https://gerrit.libreoffice.org/73386 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-05-12regenerate PCH headersLuboš Luňák
Change-Id: I4894023e42cbfa32916ee3ddfb2cfb5426cfc69f Reviewed-on: https://gerrit.libreoffice.org/72195 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-05-09regenerate PCH headers for the 4 new levelsLuboš Luňák
Plus some build fixes triggered by this. Change-Id: I59b21def706598ceffd45ae5b1f0262ec9c1ad50 Reviewed-on: https://gerrit.libreoffice.org/71581 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-05-08improve tools::Rectangle->basegfx::B2?Rectangle conversionNoel Grandin
Improve the conversion method to do something reasonable with empty Rectangle. Use the conversion method in more places. Change-Id: I48c13f3d6dae71f39f03f7939101e545c8125503 Reviewed-on: https://gerrit.libreoffice.org/71853 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-04-26Avoid manual malloc/freeStephan Bergmann
Change-Id: I7420dfde91ab52316139b446ea5c5aac79ed2350 Reviewed-on: https://gerrit.libreoffice.org/71380 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-04-13loplugin:sequentialassign in editeng..extensionsNoel Grandin
Change-Id: I95c6fb5e2ddc1c2d8a2fb1d5ff30b18ddad48b3a Reviewed-on: https://gerrit.libreoffice.org/70699 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-08new loplugin constvarsNoel Grandin
detect static variables that can be made const. Thanks to mike kaganski for suggesting this. Here I introduce a new plugin feature - using markers in nearby comments to disable the plugin for specific vars. Some of this stuff was old debugging code. I removed the stuff that was older than 5 years. Change-Id: I6ec7742a7fdadf28fd128b592fcdf6da8257585c Reviewed-on: https://gerrit.libreoffice.org/68807 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-05Assume that EMR_SETVIEWPORTEXTEX wants to read signed valuesStephan Bergmann
...similar to 095e1ca4372d90da7fc56051f1271ddd975a9e3a "Assume that EMR_SETWINDOWEXTEX wants to read signed values", this time causing "implicit conversion from type 'long' of value 4294967200 (64-bit, signed) to type 'sal_Int32' (aka 'int') changed the value to -96 (32-bit, signed)" in emfio::MtfTools::SetDevExt (emfio/source/reader/mtftools.cxx) during CppunitTest_sw_rtfexport2. Change-Id: I114cc883fd3ac78291df8190b8528384966b563f Reviewed-on: https://gerrit.libreoffice.org/68709 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-09move and extend primitive2dxmldump to drawinglayerTomaž Vajngerl
Also needs extending the XmlWriter to output double numbers as the attribute content. Change-Id: Ie749ea990d856c8c90092ed8153c24efda99c444 Reviewed-on: https://gerrit.libreoffice.org/67573 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2019-02-08loplugin:indentation in editeng..extensionsNoel Grandin
Change-Id: If7d7c400fb5d24e48b6cd02b364a8ac7fa23505d Reviewed-on: https://gerrit.libreoffice.org/67538 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-21o3tl::make_unique -> std::make_unique in dbaccess...frameworkGabor Kelemen
Since it is now possible to use C++14, it's time to replace the temporary solution with the standard one Change-Id: Iad5a422bc5a7da43d905edc91d1c46793332ec5e Reviewed-on: https://gerrit.libreoffice.org/66545 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-01-03svm xml dumper: move this from test to vclMiklos Vajna
This is very useful functionality, this way it can be invoked from the debugger and/or nested into an outer xml dump (sw/sd doc model dump) more easily. Change-Id: If6c83b11d0f3e65fcce71e8d820c6bc354f64d68 Reviewed-on: https://gerrit.libreoffice.org/65834 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2018-12-10tdf#42949 Fix IWYU warnings in include/vcl/s*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: Ie87d27dd2c385a63349e0b322fd067ba03d2d152 Reviewed-on: https://gerrit.libreoffice.org/64479 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-12-08Remove obsolete SAL_FALLTHROUGH completelyStephan Bergmann
...after 7ffdd830d5fb52f2ca25aa80277d22ea6d89970b "HAVE_CPP_ATTRIBUTE_FALLTHROUGH is always true now" Change-Id: I54e5ff4e036a6bb3e5774d1c0524158aae18e937 Reviewed-on: https://gerrit.libreoffice.org/64800 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-11-29tdf#42949 Fix IWYU warnings in include/vcl/[i-m]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: If1b2e04872eb0dd6725802c1709a9085f4cd8c91 Reviewed-on: https://gerrit.libreoffice.org/64141 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-11-19tdf#42949 Fix IWYU warnings in include/vcl/[ab]*Gabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: If18c80fc64e55d797953e24e40e5d5e62bd9c625 Reviewed-on: https://gerrit.libreoffice.org/63453 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-11-15Fix wrong path nameSamuel Mehrbrodt
Change-Id: I79ed336058ffa9e182d3332acfeda8d6526c6b43 Reviewed-on: https://gerrit.libreoffice.org/63432 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2018-11-08tdf#113624 EMF+ Fix shift of DrawString without StringFormatBartosz Kosiorek
While we are drawing DrawString record, in most cases optional StringFormat information is available. If StringFromat information is available then we should use default values. For LeadingMargin for String the default value is 1/6 inch. Change-Id: I4a0a68df5ebe74e810f8b5864232b477b3aac255 Reviewed-on: https://gerrit.libreoffice.org/62927 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2018-11-05tdf#55058 tdf#106084 tdf#114738 EMF+ Add rotation support for String drawingBartosz Kosiorek
Added rotation support for DrawString and DrawDriverString The EmfPlusDrawString record specifies text output with string formatting. The EmfPlusDrawDriverString record specifies text output with character positions. Now both EMF+ records properly support rotation. Change-Id: I15a7a6dd2b8a209cf2aac2af75d7dd89cedd1aeb Reviewed-on: https://gerrit.libreoffice.org/62783 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2018-11-02fix signatures of deleted copy/assign operatorsNoel Grandin
Change-Id: Id1a0749b78a7021be3564487fb974d7084705129 Reviewed-on: https://gerrit.libreoffice.org/62718 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-17loplugin:singlevalfieldsNoel Grandin
tighten up the handling of binary operators Change-Id: I262ec57bf7142fa094d240738150a94d83fd15ee Reviewed-on: https://gerrit.libreoffice.org/61777 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-15add SvStream::TellEndNoel Grandin
and simplify callsites to use it instead of the current "seek to end, find pos, seek back to original pos" pattern Change-Id: Ib5828868f73c341891efc759af8bd4695ae2f33c Reviewed-on: https://gerrit.libreoffice.org/61738 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-08Fix emfio_wmf_test VCL dependencyJan-Marek Glogowski
This unit test sometimes fails on Windows with the message: "no suitable windowing system found, exiting." Currently the test just depends on desktop_detector and manually sets up VCL duplicating a lot of code and even library symbols. The original Gerrit change describes a lot of failures in its comments (change 28322, version 16). Now that Windows and MacOS were converted to VCL plugins, depending on desktop_detector is not sufficient anymore. This reverts a lot of VCL test setup from commit 20f6a6b159c6 ("tdf#99402: fix Metafile Font handling"). Seems now a simple gb_CppunitTest_use_vcl is enough. Change-Id: Ia941ded91358231021741ff4a5d96e2014ac6c80 Reviewed-on: https://gerrit.libreoffice.org/61497 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2018-09-17New loplugin:externalStephan Bergmann
...warning about (for now only) functions and variables with external linkage that likely don't need it. The problems with moving entities into unnamed namespacs and breaking ADL (as alluded to in comments in compilerplugins/clang/external.cxx) are illustrated by the fact that while struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } returns 1, both moving just the struct S2 into an nunnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { namespace { struct S2: S1 { int f() { return 1; } }; } int f(S2 s) { return s.f(); } } int main() { return f(N::S2()); } as well as moving just the function f overload into an unnamed namespace, struct S1 { int f() { return 0; } }; int f(S1 s) { return s.f(); } namespace N { struct S2: S1 { int f() { return 1; } }; namespace { int f(S2 s) { return s.f(); } } } int main() { return f(N::S2()); } would each change the program to return 0 instead. Change-Id: I4d09f7ac5e8f9bcd6e6bde4712608444b642265c Reviewed-on: https://gerrit.libreoffice.org/60539 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-09-12ofz#10301 AbrtCaolán McNamara
Change-Id: I3ec766dd243fa27068ec44b16c941beaa9da1479 Reviewed-on: https://gerrit.libreoffice.org/60359 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-08-27rename ENABLE_HEADLESS option to DISABLE_GUINoel Grandin
since it has nothing to do with the headless command line option, so use the name it has in the configure.ac file Change-Id: Ibf0615ed02695d6e48a797f5632e4f417c010c70 Reviewed-on: https://gerrit.libreoffice.org/59611 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-14Assume that EMR_SETWINDOWEXTEX wants to read signed valuesStephan Bergmann
...rather than unsigned ones. With Clang's new -fsanitize=implicit-conversion, CppunitTest_vcl_filters_test fails in a way (see below) suggesting that it wants to read a negative sal_Int32 value here (that naturally extends to the same negative value of type long when constructing the Size instance) instead of a large unsigned sal_uInt32 value (that extends to a large positive (64-bit) long value). The code is like that effectively ever since its introduction with c7470f5be441d8fe80155ff29605d74d5838be26 "emfplus: add rough version of local reader". (In case that's relevant, <https://docs.microsoft.com/en-us/windows/ desktop/api/wingdi/nf-wingdi-setwindowextex> documents the SetWindowExtEx function as taking x and y parameters of (signed) int type.) > Testing file:///home/sbergman/lo/core/vcl/qa/cppunit/graphicfilter/data/wmf/fail/facename-1.wmf: > emfio/source/reader/mtftools.cxx:1961:33: runtime error: implicit conversion from type 'long' of value 2273774060 (64-bit, signed) to type 'sal_Int32' (aka 'int') changed the value to -2021193236 (32-bit, signed) > #0 in emfio::MtfTools::SetWinExt(Size const&, bool) at emfio/source/reader/mtftools.cxx:1961:33 (instdir/program/libemfiolo.so +0xedacd) > #1 in emfio::EmfReader::ReadEnhWMF() at emfio/source/reader/emfreader.cxx:754:25 (instdir/program/libemfiolo.so +0x152e99) > #2 in emfio::WmfReader::ReadWMF() at emfio/source/reader/wmfreader.cxx:1434:57 (instdir/program/libemfiolo.so +0x12f7ac) > #3 in emfio::emfreader::XEmfParser::getDecomposition(com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at emfio/source/emfuno/xemfparser.cxx:149:104 (instdir/program/libemfiolo.so +0xb14bc) > #4 in non-virtual thunk to emfio::emfreader::XEmfParser::getDecomposition(com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at emfio/source/emfuno/xemfparser.cxx (instdir/program/libemfiolo.so +0xb1e22) > #5 in VectorGraphicData::ensureSequenceAndRange() at vcl/source/gdi/vectorgraphicdata.cxx:171:137 (instdir/program/libvcllo.so +0x49121b2) > #6 in VectorGraphicData::getRange() const at vcl/source/gdi/vectorgraphicdata.cxx:273:45 (instdir/program/libvcllo.so +0x4912c4e) > #7 in VclFiltersTest::load(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int) at vcl/qa/cppunit/graphicfilter/filters-test.cxx:78:46 (workdir/LinkTarget/CppunitTest/libtest_vcl_filters_test.so +0x18010) > #8 in test::FiltersTest::recursiveScan(test::filterStatus, rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) at unotest/source/cpp/filters-test.cxx:130:20 (workdir/LinkTarget/CppunitTest/../Library/libunotest.so +0x5724c) > #9 in test::FiltersTest::testDir(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) at unotest/source/cpp/filters-test.cxx:158:5 (workdir/LinkTarget/CppunitTest/../Library/libunotest.so +0x580e7) > #10 in VclFiltersTest::testCVEs() at vcl/qa/cppunit/graphicfilter/filters-test.cxx:149:5 (workdir/LinkTarget/CppunitTest/libtest_vcl_filters_test.so +0x1a30f) > #11 in void std::__invoke_impl<void, void (VclFiltersTest::*&)(), VclFiltersTest*&>(std::__invoke_memfun_deref, void (VclFiltersTest::*&)(), VclFiltersTest*&) at /usr/lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/bits/invoke.h:73:14 (workdir/LinkTarget/CppunitTest/libtest_vcl_filters_test.so +0x2c0bd) > #12 in std::__invoke_result<void (VclFiltersTest::*&)(), VclFiltersTest*&>::type std::__invoke<void (VclFiltersTest::*&)(), VclFiltersTest*&>(void (VclFiltersTest::*&)(), VclFiltersTest*&) at /usr/lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/bits/invoke.h:95:14 (workdir/LinkTarget/CppunitTest/libtest_vcl_filters_test.so +0x2bd5b) > #13 in void std::_Bind<void (VclFiltersTest::* (VclFiltersTest*))()>::__call<void, 0ul>(std::tuple<>&&, std::_Index_tuple<0ul>) at /usr/lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/functional:400:11 (workdir/LinkTarget/CppunitTest/libtest_vcl_filters_test.so +0x2bc08) > #14 in void std::_Bind<void (VclFiltersTest::* (VclFiltersTest*))()>::operator()<void>() at /usr/lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/functional:482:17 (workdir/LinkTarget/CppunitTest/libtest_vcl_filters_test.so +0x2b945) > #15 in std::_Function_handler<void (), std::_Bind<void (VclFiltersTest::* (VclFiltersTest*))()> >::_M_invoke(std::_Any_data const&) at /usr/lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/bits/std_function.h:297:2 (workdir/LinkTarget/CppunitTest/libtest_vcl_filters_test.so +0x2aa56) > #16 in std::function<void ()>::operator()() const at /usr/lib/gcc/x86_64-redhat-linux/8/../../../../include/c++/8/bits/std_function.h:687:14 (workdir/LinkTarget/CppunitTest/libtest_vcl_filters_test.so +0x2c656) > #17 in CppUnit::TestCaller<VclFiltersTest>::runTest() at workdir/UnpackedTarball/cppunit/include/cppunit/TestCaller.h:175:7 (workdir/LinkTarget/CppunitTest/libtest_vcl_filters_test.so +0x29ec6) > #18 in CppUnit::TestCaseMethodFunctor::operator()() const at workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:32:5 (workdir/UnpackedTarball/cppunit/src/cppunit/.libs/libcppunit-1.14.so.0 +0x22c1f1) > #19 in (anonymous namespace)::Protector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) at test/source/vclbootstrapprotector.cxx:49:14 (workdir/LinkTarget/Library/libvclbootstrapprotector.so +0x159a) > #20 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const at workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25 (workdir/UnpackedTarball/cppunit/src/cppunit/.libs/libcppunit-1.14.so.0 +0x20e64d) > #21 in (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) at unotest/source/cpp/unobootstrapprotector/unobootstrapprotector.cxx:88:12 (workdir/LinkTarget/Library/unobootstrapprotector.so +0x987a) > #22 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const at workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25 (workdir/UnpackedTarball/cppunit/src/cppunit/.libs/libcppunit-1.14.so.0 +0x20e64d) > #23 in (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) at unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx:63:16 (workdir/LinkTarget/Library/unoexceptionprotector.so +0x5000) > #24 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const at workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25 (workdir/UnpackedTarball/cppunit/src/cppunit/.libs/libcppunit-1.14.so.0 +0x20e64d) > #25 in CppUnit::DefaultProtector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) at workdir/UnpackedTarball/cppunit/src/cppunit/DefaultProtector.cpp:15:12 (workdir/UnpackedTarball/cppunit/src/cppunit/.libs/libcppunit-1.14.so.0 +0x1c6c51) > #26 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const at workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25 (workdir/UnpackedTarball/cppunit/src/cppunit/.libs/libcppunit-1.14.so.0 +0x20e64d) > #27 in CppUnit::ProtectorChain::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) at workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:86:18 (workdir/UnpackedTarball/cppunit/src/cppunit/.libs/libcppunit-1.14.so.0 +0x2096b8) > #28 in CppUnit::TestResult::protect(CppUnit::Functor const&, CppUnit::Test*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) at workdir/UnpackedTarball/cppunit/src/cppunit/TestResult.cpp:182:28 (workdir/UnpackedTarball/cppunit/src/cppunit/.libs/libcppunit-1.14.so.0 +0x26c3e4) > #29 in CppUnit::TestCase::run(CppUnit::TestResult*) at workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:91:13 (workdir/UnpackedTarball/cppunit/src/cppunit/.libs/libcppunit-1.14.so.0 +0x22b1fb) > #30 in CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) at workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:64:30 (workdir/UnpackedTarball/cppunit/src/cppunit/.libs/libcppunit-1.14.so.0 +0x22db43) > #31 in CppUnit::TestComposite::run(CppUnit::TestResult*) at workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:23:3 (workdir/UnpackedTarball/cppunit/src/cppunit/.libs/libcppunit-1.14.so.0 +0x22d119) > #32 in CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) at workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:64:30 (workdir/UnpackedTarball/cppunit/src/cppunit/.libs/libcppunit-1.14.so.0 +0x22db43) > #33 in CppUnit::TestComposite::run(CppUnit::TestResult*) at workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:23:3 (workdir/UnpackedTarball/cppunit/src/cppunit/.libs/libcppunit-1.14.so.0 +0x22d119) > #34 in CppUnit::TestRunner::WrappingSuite::run(CppUnit::TestResult*) at workdir/UnpackedTarball/cppunit/src/cppunit/TestRunner.cpp:47:27 (workdir/UnpackedTarball/cppunit/src/cppunit/.libs/libcppunit-1.14.so.0 +0x28b6c2) > #35 in CppUnit::TestResult::runTest(CppUnit::Test*) at workdir/UnpackedTarball/cppunit/src/cppunit/TestResult.cpp:149:9 (workdir/UnpackedTarball/cppunit/src/cppunit/.libs/libcppunit-1.14.so.0 +0x26b715) > #36 in CppUnit::TestRunner::run(CppUnit::TestResult&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) at workdir/UnpackedTarball/cppunit/src/cppunit/TestRunner.cpp:96:14 (workdir/UnpackedTarball/cppunit/src/cppunit/.libs/libcppunit-1.14.so.0 +0x28c103) > #37 in (anonymous namespace)::ProtectedFixtureFunctor::run() const at sal/cppunittester/cppunittester.cxx:316:20 (workdir/LinkTarget/Executable/cppunittester +0x440697) > #38 in sal_main() at sal/cppunittester/cppunittester.cxx:466:20 (workdir/LinkTarget/Executable/cppunittester +0x43e2fc) > #39 in main at sal/cppunittester/cppunittester.cxx:373:1 (workdir/LinkTarget/Executable/cppunittester +0x43d90e) > #40 in __libc_start_main at /usr/src/debug/glibc-2.27-74-g68c1bf8097/csu/../csu/libc-start.c:308:16 (/lib64/libc.so.6 +0x2324a) > #41 in _start at <null> (workdir/LinkTarget/Executable/cppunittester +0x4172a9) Change-Id: Ia3899d2e80f9dc22329f7739a0c2be3cb465e967 Reviewed-on: https://gerrit.libreoffice.org/58940 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2018-08-01Add missing sal/log.hxx headersGabor Kelemen
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it. This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes. This commit adds missing headers to every file found by: grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG') to directories from dbaccess to extensions Change-Id: I4d15aa35e11664ef78c836ffc2937c7e0bb6ea59 Reviewed-on: https://gerrit.libreoffice.org/58165 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-02loplugin:unusedfields improve checking for write-only fieldsNoel Grandin
we trade off a little accuracy for finding more possible write-only fields. Change-Id: I9f7edba99481fe4ded0a9d8e45e911b0ee99d269 Reviewed-on: https://gerrit.libreoffice.org/56715 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-07assert in BitmapInfoAccess if bitmap is empty or we can't read from itNoel Grandin
and fixup the "make unique if two things want to write to bitmap at same time" check, it was using maBitmap before maBitmap has been assigned to. Lets just make it check something more useful, like the share count of the underlying SalBitmap. Change-Id: I97a629457174da2e4df1edc9674290aa9c9a2b52 Reviewed-on: https://gerrit.libreoffice.org/55416 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-12make Bitmap/BitmapEx constructors explicitNoel Grandin
and add BitmapEx::operator=(Bitmap const &) Image::Image(Bitmap const &) to lessen the fallout Change-Id: Iff5fab88d167a7be739c370c9933d36c297bc61c Reviewed-on: https://gerrit.libreoffice.org/54162 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-12hold MetaAction by rtl::ReferenceNoel Grandin
instead of yet another private implementation of manual reference counting Change-Id: Iefb1d2e595e45a2dfdc3be54e1c51b64afeaf9d8 Reviewed-on: https://gerrit.libreoffice.org/52753 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-11new loplugin:unusedvariablemoreNoel Grandin
collection of heuristics to look for local variables that are never read from i.e. do not contribute to the surrounding logic This is an expensive plugin, since it walks up the parent tree, so it is off by default. Change-Id: Ib8ba292241bd16adf299e8bba4502cb473513a06 Reviewed-on: https://gerrit.libreoffice.org/52450 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-07Revert "long->sal_Int32 in tools/gen.hxx"Stephan Bergmann
This reverts commit 8bc951daf79decbd8a599a409c6d33c5456710e0. As discussed at <https://lists.freedesktop.org/archives/libreoffice/2018-April/079955.html> "long->sal_Int32 in tools/gen.hxx", that commit caused lots of problems with signed integer overflow, and the original plan was to redo it to consistently use sal_Int64 instead of sal_Int32. <https://gerrit.libreoffice.org/#/c/52471/> "sal_Int32->sal_Int64 in tools/gen.hxx" tried that. However, it failed miserably on Windows, causing odd failures like not writing out Pictures/*.svm streams out into .odp during CppunitTest_sd_export_ooxml2. So the next best approach is to just revert the original commit, at least for now. Includes revert of follow-up 8c50aff2175e85c54957d98ce32af40a3a87e168 "Fix Library_vclplug_qt5". Change-Id: Ia8bf34272d1ed38aac00e5d07a9d13fb03f439ae Reviewed-on: https://gerrit.libreoffice.org/52532 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-04-06tdf#114738 Add support for transparency for EMF+ recordsBartosz Kosiorek
With current EMF+ implementation all filled figures, does not support transparency. This patch add transparency support for following EMF+ records: - DrawDriverString - DrawString - FillEllipse - FillRects - FillPolygon - FillPie - FillPath - FillRegion Change-Id: I1e59ea90bdf5fafc07ff9417fccace44872bbecd Reviewed-on: https://gerrit.libreoffice.org/50609 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2018-04-05ofz#7359 Integer overflowCaolán McNamara
Change-Id: I9c857f7fb8fbfceb9e061fd0bc1f0b0b63b35524 Reviewed-on: https://gerrit.libreoffice.org/52401 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>