summaryrefslogtreecommitdiff
path: root/emfio
AgeCommit message (Collapse)AuthorFilesLines
2020-05-31tdf#133448 tdf#133435 ignore broken rectangles so can we load dodgy EMF/WMFNoel Grandin2-4/+2
regression from commit 059f07f9f33460c809a93e0fda1165f5c6f6d805 fixes for code creating reversed Rectangles Change-Id: Ia4d41ac6845afcae3da1c259d8fbf48aa7db3489 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95165 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 5f260ecaddbd2b93de18f5223a7a732bcff280d9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95230
2020-05-08compact namespace in editeng..extensionsNoel Grandin1-4/+4
Change-Id: Ie93ac69592c3625b8e2e5db3619ce24597a07a7e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93722 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-07fix memory leak of xmlDoc objectsNoel Grandin2-13/+13
in unit tests Change-Id: Id16731bbbe2f1b0e3642722d77aba04fc98db4cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93508 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-27Extract getting default locale for filters into separate unotools functionMike Kaganski1-17/+2
Change-Id: Ic97b1a4507d5629963f360147ecc20eb10f5d391 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92957 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-04-27Don't convert OUString to char*Mike Kaganski1-1/+1
Change-Id: I3bfcc6fedb782b12be1fb1d42981756287f29f82 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92956 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-04-16fixes for code creating reversed RectanglesNoel Grandin2-0/+12
ie. where left > right or top > bottom These are all places where the code is self-evidently doing the wrong thing. Found by adding asserts to tools::Rectangle. In theory, this is legit, and code that wants a proper Rectangle is supposed to be first call Justify on a Rectangle, but lots of places don't do that, and that seems very dodgy to me. So lets work towards Rectangles always being in a valid state. Change-Id: I03296a624bd9b5b193e6aa8778addfb09708cdc7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92310 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-14loplugin:flatten in embeddedobj,emfioNoel Grandin3-259/+259
Change-Id: Ibaf5e1a4db1088322cf8c5e127d328b140406197 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92196 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-23make more classes private in mergedlibs modeNoel Grandin1-1/+2
Change-Id: I486922d0652f26fa7ee56f5fe308e19fe5ff137e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90856 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-16tdf#124424 EMF+ Extend test options of SvgLinearGradientPrimitive2DBartosz Kosiorek1-0/+9
The extended options were used in LinearGradient tests Change-Id: I44336edda2d82f936b6e931668bdac46ee7899e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90541 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2020-03-15tdf#124424 EMF+ Add tests for LinearGradientBartosz Kosiorek2-0/+26
Change-Id: I85dadb067c4e77b47504dee8bb11b4c15b6ead8d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90536 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2020-03-12comparison operators should be constNoel Grandin1-2/+2
Change-Id: Ifa76e004128223460945d58d1c59c4e23db0f108 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90370 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-21Drop o3tl::optional wrapperStephan Bergmann1-3/+3
...now that macOS builds are guaranteed to have std::optional since 358146bbbd1b9775c12770fb5e497b6ec5adfc51 "Bump macOS build baseline to Xcode 11.3 and macOS 10.14.4". The change is done mostly mechanically with > for i in $(git grep -Fl optional); do > sed -i -e 's:<o3tl/optional\.hxx>\|\"o3tl/optional\.hxx\":<optional>:' \ > -e 's/\<o3tl::optional\>/std::optional/g' \ > -e 's/\<o3tl::make_optional\>/std::make_optional/g' "$i" > done > for i in $(git grep -Flw o3tl::nullopt); do > sed -i -e 's/\<o3tl::nullopt\>/std::nullopt/g' "$i" > done (though that causes some of the resulting #include <optional> to appear at different places relative to other includes than if they had been added manually), plus a few manual modifications: * adapt bin/find-unneeded-includes * adapt desktop/IwyuFilter_desktop.yaml * remove include/o3tl/optional.hxx * quote resulting "<"/">" as "&lt;"/"&gt;" in officecfg/registry/cppheader.xsl * and then solenv/clang-format/reformat-formatted-files Change-Id: I68833d9f7945e57aa2bc703349cbc5a56b342273 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89165 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-02-16clang-format c*,d*,e* with under 5-percent lines of changeMuhammet Kara1-12/+13
Files which could become clang-format conformant with under 5-percent lines of change relative to the total count of lines in the file are found by using bin/find-clang-format.py, and fixed with /opt/lo/bin/clang-format -i <path-of-the-file> There will be follow-up patches to fix all 'under-5-percent' files. Change-Id: I06087a1385ca9da6a28d36ea4c0d2e40bdbf8f03 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88774 Tested-by: Jenkins Reviewed-by: Muhammet Kara <muhammet.kara@collabora.com>
2020-02-01make update_pch also consider files in <module>/src/**/incLuboš Luňák1-4/+2
With --enable-pch=full there's not much difference between a "public" header in <module>/inc and a private one in <module>/src/somewhere/inc . And since the script searches recursively, this apparently helps to find even more headers for lower pch levels. Change-Id: I8483d0aa5b4fea5a59107c20a8aa5f1ef694af0a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87799 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-01-31clang-tidy modernize-concat-nested-namespaceNoel Grandin1-15/+6
Change-Id: Iab35a8b85b3ba1df791c774f40b037f9420a071a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86708 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-28New loplugin:unsignedcompareStephan Bergmann2-4/+5
"Find explicit casts from signed to unsigned integer in comparison against unsigned integer, where the cast is presumably used to avoid warnings about signed vs. unsigned comparisons, and could thus be replaced with o3tl::make_unsigned for clairty." (compilerplugins/clang/unsignedcompare.cxx) o3tl::make_unsigned requires its argument to be non-negative, and there is a chance that some original code like static_cast<sal_uInt32>(n) >= c used the explicit cast to actually force a (potentially negative) value of sal_Int32 to be interpreted as an unsigned sal_uInt32, rather than using the cast to avoid a false "signed vs. unsigned comparison" warning in a case where n is known to be non-negative. It appears that restricting this plugin to non- equality comparisons (<, >, <=, >=) and excluding equality comparisons (==, !=) is a useful heuristic to avoid such false positives. The only remainging false positive I found was 0288c8ffecff4956a52b9147d441979941e8b87f "Rephrase cast from sal_Int32 to sal_uInt32". But which of course does not mean that there were no further false positivies that I missed. So this commit may accidentally introduce some false hits of the assert in o3tl::make_unsigned. At least, it passed a full (Linux ASan+UBSan --enable-dbgutil) `make check && make screenshot`. It is by design that o3tl::make_unsigned only accepts signed integer parameter types (and is not defined as a nop for unsigned ones), to avoid unnecessary uses which would in general be suspicious. But the STATIC_ARRAY_SELECT macro in include/oox/helper/helper.hxx is used with both signed and unsigned types, so needs a little oox::detail::make_unsigned helper function for now. (The ultimate fix being to get rid of the macro in the first place.) Change-Id: Ia4adc9f44c70ad1dfd608784cac39ee922c32175 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87556 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-20fix constants according to [MS-EMF] 2.1.10Andras Timar1-2/+2
Change-Id: I048eb097e9570f2ad2fecef5e725c98e36e6559e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87078 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
2020-01-15tweak GetBitmap methods in BitmapExNoel Grandin1-4/+4
so we return a const& for the normal case, just like other methods, which reduces copying. This revealed that CreateDisplayBitmap in Bitmap can be const. Change-Id: I9f9b9ff0c52d7e95eaae62af152218be8847dd63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86836 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-14loplugin:finalclasses in basic..emfioNoel Grandin1-3/+3
Change-Id: I1b0df1a6cb5b8db9db09cb1d55d932459ab16d81 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86741 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-10use more std::make_sharedNoel Grandin1-2/+2
found using 'git grep', I tried using clang-tidy, but it only successfully found a tiny fraction of these Change-Id: I61c7d85105ff7a911722750e759d6641d578da33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86526 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-20tdf#42949 Fix IWYU warnings in emfio/Gabor Kelemen8-24/+7
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I644bbebe798329e68665b8c751eccbb829178e91 Reviewed-on: https://gerrit.libreoffice.org/85182 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-12-19sal_Char->char in editeng..eventattacherNoel Grandin1-1/+1
Change-Id: Ia9c736042a07a17377db6d88c5bcd2b468e98777 Reviewed-on: https://gerrit.libreoffice.org/85471 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-06Fix some new dependencies on boost_headersStephan Bergmann1-0/+1
...caused by a8cd98c437f2c3b5c4f7c139aa7223c5cfb74d1a "use o3tl::optional instead of pointer", see <https://ci.libreoffice.org/job/gerrit_mac/48607>: > In file included from /Users/tdf/lode/jenkins/workspace/lo_gerrit/Config/macosx_clang_dbgutil/connectivity/qa/connectivity/resource/sharedresources_test.cxx:10: > In file included from /Users/tdf/lode/jenkins/workspace/lo_gerrit/Config/macosx_clang_dbgutil/include/test/bootstrapfixture.hxx:16: > In file included from /Users/tdf/lode/jenkins/workspace/lo_gerrit/Config/macosx_clang_dbgutil/include/vcl/salctype.hxx:25: > In file included from /Users/tdf/lode/jenkins/workspace/lo_gerrit/Config/macosx_clang_dbgutil/include/vcl/graph.hxx:27: > In file included from /Users/tdf/lode/jenkins/workspace/lo_gerrit/Config/macosx_clang_dbgutil/include/vcl/bitmapex.hxx:23: > /Users/tdf/lode/jenkins/workspace/lo_gerrit/Config/macosx_clang_dbgutil/include/o3tl/optional.hxx:20:10: fatal error: 'boost/none.hpp' file not found > #include <boost/none.hpp> > ^~~~~~~~~~~~~~~~ > In file included from /Users/tdf/lode/jenkins/workspace/lo_gerrit/Config/macosx_clang_dbgutil/connectivity/qa/connectivity/commontools/FValue_test.cxx:20: > In file included from /Users/tdf/lode/jenkins/workspace/lo_gerrit/Config/macosx_clang_dbgutil/include/test/bootstrapfixture.hxx:16: > In file included from /Users/tdf/lode/jenkins/workspace/lo_gerrit/Config/macosx_clang_dbgutil/include/vcl/salctype.hxx:25: > In file included from /Users/tdf/lode/jenkins/workspace/lo_gerrit/Config/macosx_clang_dbgutil/include/vcl/graph.hxx:27: > In file included from /Users/tdf/lode/jenkins/workspace/lo_gerrit/Config/macosx_clang_dbgutil/include/vcl/bitmapex.hxx:23: > /Users/tdf/lode/jenkins/workspace/lo_gerrit/Config/macosx_clang_dbgutil/include/o3tl/optional.hxx:20:10: fatal error: 'boost/none.hpp' file not found > #include <boost/none.hpp> > ^~~~~~~~~~~~~~~~ > In file included from /Users/tdf/lode/jenkins/workspace/lo_gerrit/Config/macosx_clang_dbgutil/emfio/qa/cppunit/emf/EmfImportTest.cxx:13: > In file included from /Users/tdf/lode/jenkins/workspace/lo_gerrit/Config/macosx_clang_dbgutil/include/test/bootstrapfixture.hxx:16: > In file included from /Users/tdf/lode/jenkins/workspace/lo_gerrit/Config/macosx_clang_dbgutil/include/vcl/salctype.hxx:25: > In file included from /Users/tdf/lode/jenkins/workspace/lo_gerrit/Config/macosx_clang_dbgutil/include/vcl/graph.hxx:27: > In file included from /Users/tdf/lode/jenkins/workspace/lo_gerrit/Config/macosx_clang_dbgutil/include/vcl/bitmapex.hxx:23: > /Users/tdf/lode/jenkins/workspace/lo_gerrit/Config/macosx_clang_dbgutil/include/o3tl/optional.hxx:20:10: fatal error: 'boost/none.hpp' file not found > #include <boost/none.hpp> > ^~~~~~~~~~~~~~~~ Change-Id: I86ccc030a8f34b9ee6a853e843c9eb6f2d987406 Reviewed-on: https://gerrit.libreoffice.org/84664 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-12-04vcl: fix number of polygons shown in SAL_INFO messageChris Sherlock1-1/+1
Change-Id: I9a2c28f465b881583caae8d865d63b701213f8ee Reviewed-on: https://gerrit.libreoffice.org/84139 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2019-12-01Introduce o3tl::optional as an alias for std::optionalStephan Bergmann2-4/+4
...with a boost::optional fallback for Xcode < 10 (as std::optional is only available starting with Xcode 10 according to <https://en.cppreference.com/w/cpp/compiler_support>, and our baseline for iOS and macOS is still Xcode 9.3 according to README.md). And mechanically rewrite all code to use o3tl::optional instead of boost::optional. One immediate benefit is that disabling -Wmaybe-uninitialized for GCC as per fed7c3deb3f4ec81f78967c2d7f3c4554398cb9d "Slience bogus -Werror=maybe-uninitialized" should no longer be necessary (and whose check happened to no longer trigger for GCC 10 trunk, even though that compiler would still emit bogus -Wmaybe-uninitialized for uses of boost::optional under --enable-optimized, which made me ponder whether this switch from boost::optional to std::optional would be a useful thing to do; I keep that configure.ac check for now, though, and will only remove it in a follow up commit). Another longer-term benefit is that the code is now already in good shape for an eventual switch to std::optional (a switch we would have done anyway once we no longer need to support Xcode < 10). Only desktop/qa/desktop_lib/test_desktop_lib.cxx heavily uses boost::property_tree::ptree::get_child_optional returning boost::optional, so let it keep using boost::optional for now. After a number of preceding commits have paved the way for this change, this commit is completely mechanical, done with > git ls-files -z | grep -vz -e '^bin/find-unneeded-includes$' -e '^configure.ac$' -e '^desktop/qa/desktop_lib/test_desktop_lib.cxx$' -e '^dictionaries$' -e '^external/' -e '^helpcontent2$' -e '^include/IwyuFilter_include.yaml$' -e '^sc/IwyuFilter_sc.yaml$' -e '^solenv/gdb/boost/optional.py$' -e '^solenv/vs/LibreOffice.natvis$' -e '^translations$' -e '\.svg$' | xargs -0 sed -i -E -e 's|\<boost(/optional)?/optional\.hpp\>|o3tl/optional.hxx|g' -e 's/\<boost(\s*)::(\s*)(make_)?optional\>/o3tl\1::\2\3optional/g' -e 's/\<boost(\s*)::(\s*)none\>/o3tl\1::\2nullopt/g' (before committing include/o3tl/optional.hxx, and relying on some GNU features). It excludes some files where mention of boost::optional et al should apparently not be changed (and the sub-repo directory stubs). It turned out that all uses of boost::none across the code base were in combination with boost::optional, so had all to be rewritten as o3tl::nullopt. Change-Id: Ibfd9f4b3d5a8aee6e6eed310b988c4e5ffd8b11b Reviewed-on: https://gerrit.libreoffice.org/84128 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-30tdf#129106 vcl: add SAL_INFO to show the dxArray intercharacter spacingsChris Sherlock1-0/+2
Change-Id: I948555cb4895390ded8b6c9b257486cdce175185 Reviewed-on: https://gerrit.libreoffice.org/84096 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2019-11-23emfio: extra loggingChris Sherlock3-64/+211
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 Bergmann1-0/+4
...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 Sherlock1-1/+3
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 Grandin1-1/+1
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ňák1-2/+1
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 McNamara1-0/+6
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 Grandin1-2/+2
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ňák1-1/+1
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 Gelmini1-2/+2
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 Bergmann2-2/+2
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 Glogowski1-0/+5
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 Grandin1-1/+0
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 Grandin1-14/+14
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 McNamara1-7/+9
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 Bergmann2-2/+4
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ňák1-2/+2
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ňák1-4/+15
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 Grandin1-4/+2
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 Bergmann1-3/+3
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 Grandin1-3/+1
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 Grandin1-1/+1
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 Bergmann1-2/+3
...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ž Vajngerl1-5/+5
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 Grandin2-4/+4
Change-Id: If7d7c400fb5d24e48b6cd02b364a8ac7fa23505d Reviewed-on: https://gerrit.libreoffice.org/67538 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>