summaryrefslogtreecommitdiff
path: root/emfio/inc
AgeCommit message (Collapse)AuthorFilesLines
2021-03-25WMF/EMF Convert all index type of Objects to unsignedBartosz Kosiorek1-3/+3
Based on WMF and EMF documentation, all indexes should be unsigned. With this commit it was applied, which simplifies code. Change-Id: I3257da7e595ace45622c6d865fd4b034dc605cb8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113039 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-03-09Make sal/config.h the first in pchMike Kaganski1-2/+2
By convention, it should be the first include in C/CXX files; so use of pch should not break that. Change-Id: Ic329c5f39e8f48ad1778724368e262e48972342b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112123 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-02-23tdf#127471 Detect&Correct EMF/WMF with wrong FontScaleArmin Le Grand (Allotropia)1-0/+24
Before correcting our EMF/WMF export to write the Windows- specific data in the case of FontScaling, we wrote these files with wrong FontScaling. This change tries to detect and correct this at import, so that newer versions of the office on all plattforms can again load old, from us but not on Windows written EMF/WMF files. With this change we can read again all new and old EMF/WMF files (see table in task, comment 80). Change-Id: I1a0b0ab5f57c7cd40520401568af05cab4ecb4c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111399 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2021-02-19update pchesCaolán McNamara1-1/+2
Change-Id: Ic4586057346b6de700c1bb6ff4cd759a11bb3e4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111231 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-15update pchesCaolán McNamara1-2/+2
Change-Id: I280dea8fe5f346a5555f4bf479896877579d63e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107748 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-09vcl: improve EMF+ -> WMF conversionMiklos Vajna1-0/+2
We throw away EMF fallback info when parsing EMF+ data. This means that the resulting GDIMetaFile (containing EMF+ data but no EMF fallback) is tricky to export to WMF, where EMF+ comments are not allowed. Improve the conversion result by re-parsing such EMF+ data with EMF+ disabled, and then converting the GDIMetaFile (containing EMF fallback data) to WMF. Change-Id: Ib2c0388f1344aef7f601ce9be59e4a8924e8085b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107453 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-11-13tdf#123936 Formatting files in module emfio with clang-formatPhilipp Hofer1-2/+2
Change-Id: I5b0867630741713d08f533dc76c82bfb1cad9cbb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105666 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-10-27tdf#137413 EMF import: fix transparency in the PDF fallback caseMiklos Vajna1-1/+4
Commit d75c5b38911557173c54a78f42ff220ab3918573 (tdf#136836 emfio: speed up import of EMF import when the orig PDF is available, 2020-09-17) improved both performance and correctness of the EMF import, in case it had a PDF fallback. It turns out that PDF fallback can be nominally non-transparent, and still the EMF equivalent supports transparency. Fix the problem by enabling transparency in the PDF-in-EMF case. Change-Id: I4d1585a5db6f28bd9c9cb380b5f193f4d5edcc8d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104849 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-10-22long->tools::Long in emfio..filterNoel1-2/+2
Change-Id: I961cee10d45d628ff70dea0694a7a63a4fe867ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104624 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-21update pchesCaolán McNamara1-1/+4
Change-Id: I41a204fbc5e2c9b819fb948c5288f8d7b4195489 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103117 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-18[API CHANGE] tdf#136836 emfio: set size hint on inner PDF if used as shape fillMiklos Vajna1-0/+2
The bugdoc has a shape, its bitmap fill is an EMF, which is actually a PDF. The PDF is has a height of 5cm, but the shape has a height of 14 cm. Inform vcl::RenderPDFBitmaps() about the size of the shape, so the result won't be blurry. This approach makes sure that we don't unconditionally render at higher resolution, i.e. the "load a PDF of 100 pages into Online" use-case won't use more memory than before. API CHANGE, because the EMF reader is only available via UNO, though it's likely that no actual external code would ever invoke it directly. Change-Id: If1d8def0136d408a31a0cc54777a7f26430a0ff3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102996 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-09-17Fix typoAndrea Gelmini1-1/+1
Change-Id: I7840929712a8e9bd3f46b2c718cf430b97e9b683 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102970 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2020-09-17tdf#136836 emfio: speed up import of EMF import when the orig PDF is availableMiklos Vajna1-0/+4
The PPTX bugdoc has a 17MB EMF file, which has enough instructions to keep Impress busy for minutes during import. Take advantage of the detail that this EMF has a EMR_COMMENT_MULTIFORMATS record that contains the original PDF, which can be rendered much faster: - old cost: 122.153 seconds - new cost: 1.952 seconds (1.6% of baseline) Change-Id: I38efc1c24e21a7622377b9e1c1938ebee826bae9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102918 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-08-12SvTreeListBox can move into toolkit headers nowCaolán McNamara1-2/+1
Change-Id: I6b3b6ef1530a192f4b6bf87aa9688687063683ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100591 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-07-12update pchesCaolán McNamara1-5/+1
Change-Id: I75602277a5a26b012a12f2c4f4b7ff5bb663b0b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98474 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
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-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-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-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>
2019-12-20tdf#42949 Fix IWYU warnings in emfio/Gabor Kelemen1-1/+0
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-01Introduce o3tl::optional as an alias for std::optionalStephan Bergmann1-1/+1
...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-23emfio: extra loggingChris Sherlock1-0/+1
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-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-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-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-04Avoid truncation of ±1E20 to longStephan Bergmann1-0/+1
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-01-21o3tl::make_unique -> std::make_unique in dbaccess...frameworkGabor Kelemen1-1/+0
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>
2018-11-02fix signatures of deleted copy/assign operatorsNoel Grandin1-2/+2
Change-Id: Id1a0749b78a7021be3564487fb974d7084705129 Reviewed-on: https://gerrit.libreoffice.org/62718 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-02loplugin:unusedfields improve checking for write-only fieldsNoel Grandin1-1/+0
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-02-27replace Color(COL_*) with COL_*Noel Grandin1-1/+1
using git grep -lwP "Color\s*\(\s*(COL_\w+)\s*\)" | xargs perl -pi -e "s/Color\s*\(\s*(COL_\w+)\s*\)//g" and then some manual fixup where the resulting expression no longer compiled Change-Id: I0e268d78611c3be40bba9f60ecfdc087a36c0df4 Reviewed-on: https://gerrit.libreoffice.org/50372 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-12-31loplugin:passstuffbyref improved return in emfio,writerfilterNoel Grandin1-1/+1
Change-Id: I237936d62d0f1b17574dd88b5c9de932dc03238e Reviewed-on: https://gerrit.libreoffice.org/47214 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-18silence some coverity warningsCaolán McNamara1-1/+1
Change-Id: I5a530e37156b5cd36e8a07ac20851880a46f520d Reviewed-on: https://gerrit.libreoffice.org/44875 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-11-14ofz: stop at min of end of record and end of streamCaolán McNamara1-4/+4
Change-Id: I61c7cf74ea75ec56b6ccb3661f6fdd54a1ff12e1 Reviewed-on: https://gerrit.libreoffice.org/44705 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-11-06loplugin:constparams in various(2)Noel Grandin1-1/+1
Change-Id: I533a7eb724b15e168a28dc92cd5962a39bc96e7c Reviewed-on: https://gerrit.libreoffice.org/44313 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-26tdf#31814 EMF/EMF+ implement dual modePatrick Jaap1-0/+1
There can be a dual mode flag set in the EMF+ data. If set, we should process either EMF or EMF+ data, because the contained information should be equal (says the documentation). The more advanced EMF+ renderer is chosen here. The flag is read in the EMFPlusReader and blocks the reading of other EMF records than HEADER, EOF and COMMENT. Thanks to Chris, for pointing out the dual mode! Change-Id: I8522930cebbb9e9ecc732397cbb3deea9e8c9127 Reviewed-on: https://gerrit.libreoffice.org/43122 Reviewed-by: Patrick Jaap <patrick.jaap@tu-dresden.de> Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl> Tested-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2017-10-23loplugin:includeform: emfioStephan Bergmann2-2/+2
Change-Id: Icc71e73fad45d397e17ae4b6ba4967ec7a50ae27
2017-09-26Rename the basegfx::tools namespace to basegfx::utilsTor Lillqvist1-2/+2
Reduce potential confusion with the global tools namespace. Will hopefully make it possible to remove the annoying initial :: when referring to the global tools namespace. Unless we have even more tools subnamespaces somewhere. Thorsten said it was OK. Change-Id: Id088dfe8f4244cb79df9aa988995b31a1758c996 Reviewed-on: https://gerrit.libreoffice.org/42644 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com>
2017-09-25Conditional jump or move depends on uninitialised valueCaolán McNamara1-0/+16
Change-Id: I772c38c62950edbcde450889bae61dc37118b8cd
2017-09-22Fresh run of bin/update_pch.shMike Kaganski1-2/+18
Change-Id: I69d4157aaf6570cecd51ea59df20556914942e06 Reviewed-on: https://gerrit.libreoffice.org/42565 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2017-08-29Make WinMtfFontStyle's base class EMFIO_DLLPUBLIC, tooStephan Bergmann1-1/+1
...otherwise the dynamic_cast<WinMtfFontStyle*> in MtfTools::SelectObject (emfio/source/reader/mtftools.cxx) would not work on macOS in CppunitTest_emfio_wmf Change-Id: I5c361544fd273bdb65a4b83c7d694bae714815f5
2017-07-31loplugin:constparams in dbaccessNoel Grandin1-3/+3
Change-Id: I4994c4f0ae614c8f98466f440412f28380ddd6a6 Reviewed-on: https://gerrit.libreoffice.org/40589 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-17no need to statically link against the emfio library in the testsMarkus Mohrhard2-2/+40
ODR-violation found by ASAN: ==17022==ERROR: AddressSanitizer: odr-violation (0x2b86adb17c60): [1] size=352 'vtable for emfio::emfreader::XEmfParser' /home/tdf/lode/jenkins/workspace/lo_ubsan/emfio/source/emfuno/xemfparser.cxx [2] size=352 'vtable for emfio::emfreader::XEmfParser' /home/tdf/lode/jenkins/workspace/lo_ubsan/emfio/source/emfuno/xemfparser.cxx These globals were registered at these points: [1]: #0 0x443a73 in __asan_register_globals /home/tdf/lode/packages/llvm-3.8.0.src/projects/compiler-rt/lib/asan/asan_globals.cc:218 #1 0x2b86bea2dced in asan.module_ctor (/workdir/LinkTarget/CppunitTest/libtest_emfio_wmf.so+0x1a0ced) #2 0x7fff394ad75a (<unknown module>) [2]: #0 0x443a73 in __asan_register_globals /home/tdf/lode/packages/llvm-3.8.0.src/projects/compiler-rt/lib/asan/asan_globals.cc:218 #1 0x2b86ad6e862d in asan.module_ctor (/workdir/LinkTarget/CppunitTest/libtest_emfio_emf.so+0x18862d) #2 0x7fff394ad75a (<unknown module>) Change-Id: Id98677a3692ac6a0586164aa5d0a2c82ab26f916 Reviewed-on: https://gerrit.libreoffice.org/40029 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2017-07-15emfplus: UnitTests and gerrit build correctionsArmin Le Grand1-1/+1
Needed to migrate UnitTest for Emf/Wmf import from vcl to emfio. Corrected stuff based on gerrit build feedback Change-Id: I7fd2456f814ea19583072ba09730a07e9b9d4061
2017-07-15emfplus: completed isolation/migration of Emf/WmfArmin Le Grand2-4/+10
Decided to keep the migrated/isolated Emf/Wmf reader which are now hidden behind a Uno Api. Had to re-implement WMF_EXTERNALHEADER (now WmfExternal, own file/header) to not break anything. It *seems* to just scale something and could be done after import, but I could not be sure. Also needed a callback hook to allow getting the Metafile out of a MetafilePrimitive in a lower module (vcl relative to drawinglayer) which is needed as long as primitives are not completely on Uno Api. Deleted all Emf/Wmf reader stuff from vcl. Change-Id: Ic5540defa8ec770728280df4df3f12e1f48cfc3a
2017-07-15emfplus: more streamlining of metafile importerArmin Le Grand1-12/+2
Change-Id: Ice0f779f8026983fd0884c2a02e9fd7220b498dc
2017-07-15emfplus: reorganized some old filter aspectsArmin Le Grand3-115/+65
Change-Id: I1949e851c560a81a461ec42a992f3b2cb0d019f8
2017-07-15emfplus: add rough version of local readerArmin Le Grand3-0/+828
Complete redevelopent is too expensive, start with adding a copy of the existing vcl importer which will in the next steps be adapted to import primitives instead of MetaFile(Actions). Adapted namespace, made compile and added sample code to roughly use it Change-Id: I79e7ea0d78099fbbe18e2a595457b2ab353f58ea