summaryrefslogtreecommitdiff
path: root/vcl/source/filter/wmf/winwmf.cxx
AgeCommit message (Collapse)Author
2017-07-15emfplus: completed isolation/migration of Emf/WmfArmin Le Grand
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-05new loplugin unnecessaryparenNoel Grandin
Change-Id: Ic883a07b30069ca6342d7521c8ad890f4326f0ec Reviewed-on: https://gerrit.libreoffice.org/39549 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-17loplugin:unusedfields in vcl part2Noel Grandin
Change-Id: Icd02f63e9738c0bb91348e2084649f9edc281e67 Reviewed-on: https://gerrit.libreoffice.org/38833 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-24drop old WinMtfOutput::DrawPolygon methodNoel Grandin
Change-Id: I7e9696718149f0d708e029efa0edbfa2b4f62b89 Reviewed-on: https://gerrit.libreoffice.org/36880 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-02ofz: avoid oomCaolán McNamara
Change-Id: Ibffae78a1186492300c237e85089702491cf4a0f
2017-03-31tdf#82580 tools: rename Rectangle to tools::RectangleMiklos Vajna
Mostly generated using make check COMPILER_EXTERNAL_TOOL=1 CCACHE_PREFIX=clang-rename-wrapper RENAME_ARGS="-qualified-name=Rectangle -new-name=tools::Rectangle" Except some modules have their own foo::tools namespace, so there have to use ::tools::Rectangle. This commit just moves the class from the global namespace, it does not update pre/postwin.h yet. Change-Id: I42b2de3c6f769fcf28cfe086f98eb31e42a305f2 Reviewed-on: https://gerrit.libreoffice.org/35923 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
2017-03-08loplugin:loopvartoosmallStephan Bergmann
Change-Id: Ie173849c0956edf9fd111120fa4bdfb2930ab69f
2017-03-03ofz: avoid oomCaolán McNamara
Change-Id: Ib3f7ce3e8e7365622f89de5c63615ae321149aa6
2017-02-24ofz: slow unitCaolán McNamara
Change-Id: I482a6c95810d03e47a5be18e6b45ee4db19f56e4
2017-02-24clarify this code a little bitCaolán McNamara
no logic change intended Change-Id: I620822e71386bae05312474423c22b84d8608cbd
2016-12-29Add support for ETO_PDY in WMF/EMFMike Kaganski
Currently it is implemented by making all characters different text arrays. Unit test included. Change-Id: I850bf192cf5d978a126d3f37b1084021d37bdf30 Reviewed-on: https://gerrit.libreoffice.org/32490 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2016-12-27tdf#39894: Metafile: use distance from last char cell to nextMike Kaganski
The optional Dx array of WMF's META_EXTTEXTOUT (and its EMF counterpart) define not only spacing between char cells of this record, but also of spacing to first char cell of next text (if TA_UPDATECP is set). Additionally, both WMF and EMF EXTTEXTOUT records define not only X spacing, but also Y (if ETO_PDY is set in its options). Unit test is included. Change-Id: I45ed872210c81b3050ba65d68145b64861bfec22 Reviewed-on: https://gerrit.libreoffice.org/32436 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2016-12-22valgrind: stick 0 at end of successfully read dataCaolán McNamara
Change-Id: Id79f68c9095ab313ac05d2c8b55df71788df81d3
2016-12-15teach sallogareas plugin to catch inconsistenciesNoel Grandin
Change-Id: I8bcea5ffc74d48148bea78da8c17744e288c069a Reviewed-on: https://gerrit.libreoffice.org/32004 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-10oss-fuzz: handle W_META_CREATEFONTINDIRECT like EMR_EXTCREATEFONTINDIRECTWCaolán McNamara
Change-Id: Iaa142d5d0ac0f00e89e8b7d7ffdef8137157cec9
2016-12-09oss-fuzz we don't want this stream to automatically resize on seeks past endCaolán McNamara
Change-Id: Ie42b2e173cd3ed9faaf17c3c978227613129fa84
2016-12-05Change Read/Write access to Scoped Read/Write accessMark Page
Change-Id: I4834d057e1997710f5ac9691d6c3eecb24e26881 Reviewed-on: https://gerrit.libreoffice.org/31550 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-05convert MapUnit to scoped enumNoel Grandin
I left a prefix on the names "Map" so that I would not have to re-arrange each name too much, since I can't start identifiers with digits like "100thMM" And remove RSC_EXTRAMAPUNIT, which doesn't seem to be doing anything anymore. Change-Id: I5187824aa87e30caf5357b51b5384b5ab919d224 Reviewed-on: https://gerrit.libreoffice.org/29096 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-15replace sal_Size with std::size_t (or sal_uInt64 for SvStream pos)Michael Stahl
... except in include/rtl, include/sal, include/uno, where sal_Size is retained for compatibility, and where callers of rtl functions pass in pointers that are incompatible on MSVC. Change-Id: I8344453780689f5120ba0870e44965b6d292450c
2016-09-05convert LineStyle to scoped enumNoel Grandin
Change-Id: I30cfa5a0649b806604c443f55683d1f2a430983d
2016-06-27loplugin:singlevalfields in vcl(part2)Noel Grandin
Change-Id: I4782c6f6d3d090ba0f9e29af8afdd7d88aa2d382 Reviewed-on: https://gerrit.libreoffice.org/26598 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-17convert DBG_ASSERT in vclNoel Grandin
Change-Id: I732fb1a789f90ca7a7f393cc41a6afe84fecf3d3 Reviewed-on: https://gerrit.libreoffice.org/26200 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-06tools: rename SvStream::Read/Write to ReadBytes/WriteBytesMichael Stahl
Change-Id: Ib788a30d413436aa03f813aa2fddcbc4d6cd2f9a Reviewed-on: https://gerrit.libreoffice.org/25972 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-06-03Convert ComplexTextLayoutMode to scoped enumNoel Grandin
Change-Id: I257f8e15fec92f0701235a6fe4b6a2272498c4f1 Reviewed-on: https://gerrit.libreoffice.org/25667 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-30Convert MTF R2 constants to scoped enumNoel Grandin
Change-Id: I9c18e5bbbd176cf5276000e43f4c3a993e4e0d87 Reviewed-on: https://gerrit.libreoffice.org/25545 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-09Update the wmf filter to simplify object ownershipMark Page
Changed the GDI style structures to use inheritance, thus object deletion no longer requires a static_cast Used std::unique_ptr for GDI objects to enforce object ownership Modified the WMF Writer to use std::vector, instead of a raw pointer array when processing handles Change-Id: Ic635ff9d641427b901eb18468529ea6367859b53 Reviewed-on: https://gerrit.libreoffice.org/24634 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-03-04tdf#79679 vcl: dashed lines show as solid lines when importing EMF filesChris Sherlock
Issue is a regression in commit 09c722873b2d378d2d155f5f1dd7d8f3fb2012e9. (EMF/WMF: fix rendering of pen styles (dash, dot, dashdot, dashdotdot). I've looked at how the latest version of Word on the Mac works, and it turns out that the spacings for the PenStyle enumerations in the LogPen objects for all the create pen EMF records are as follows: * PS_DOT - ■ □ ■ □ ■ □ ■ □ ■ □ ■ * PS_DASHDOT - ■ ■ ■ □ ■ □ ■ ■ ■ □ ■ * PS_DASHDOTDOT - ■ ■ ■ □ ■ □ ■ □ ■ ■ ■ (where ■ is the actual filled in area, and □ is the space between the filled in areas) In other words, each dash fills in the space of three dots, and there is the one dot worth of empty space between the dashes and dots. Each "dot" has a width and height equal to the width specified in the pen. So basically, we seem to be arbitrarily setting the dot, dash and distance lengths arbitrarily, which were reasonable guesses but tended to produce very odd lines at different zoom levels. Change-Id: Ie8b5fa396e4fb0f480cb3594c8129a59f472c1b8 Reviewed-on: https://gerrit.libreoffice.org/22886 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-21valgrind: memleak on thrown exceptionCaolán McNamara
Change-Id: I2788c5fe04a984d6534adbd3186cc652685152e8
2016-01-18loplugin: unused return values in vcl/Noel Grandin
Change-Id: I879bd3bec4dd2cf002681f1e50b6c33cce0934a9
2016-01-17vcl: rename Font::GetName to Font::GetFamilyNameChris Sherlock
Change-Id: Ie20871a3078bf875c1782b7761d60591a9c9704f Reviewed-on: https://gerrit.libreoffice.org/21529 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-16revert vcl patch series that brok Mac and WindowsNorbert Thiebaud
revert: 9bc2f3de8672e812f3a67541c6d7069b434a7e42 vcl: add comment about ImplFontMetric::{Get|Set}LineHeight() 26371f105bc44e04469ec03fc5bb12505e651c6b vcl: FontAttributes::GetSlantType() -> FontAttributes::GetItalic() 2dd0b4317372b8022efe3911b38b4fa02956d8b9 vcl: font.hxx and metric.hxx cleanup, make ctors explicit and the dtor virtual 5ab13bf3ead3539e4ad847656da81e7eb6029652 vcl: tabify font.hxx f99550dae55e40e49bf9c9875053fe2abb4c71ca vcl: change Font::SetName() to Font::SetFamilyName() 2b297116cb6bb1061c43e5714e2609c8ee9f57d2 vcl: rename Font::GetName to Font::GetFamilyName Change-Id: I23f38921187d66b970ca815eb30dda4222a2da62
2016-01-16vcl: rename Font::GetName to Font::GetFamilyNameChris Sherlock
Change-Id: I83927e0992dfe0a2a79d139818a9f45d3761aae5 Reviewed-on: https://gerrit.libreoffice.org/21509 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-08Revert "vcl: move filter headers to vcl/inc/filter"Chris Sherlock
Discussed on IRC - overwhelming consensus is to keep the headers where they were before. The main reason to keep them in the same directory is to keep headers as local as possible to the source files, unless something else needs to access it. The only thing that uses the headers is vc/workben/fftester.cxx I will work out how to get Doxygen to pick up these headers another way. This reverts commit 5d7772fc0464c867c5ad2f1e10ccabd7331f7efa. Change-Id: I45ee970722e27748ab8af8909ac49579dc47ef56 Reviewed-on: https://gerrit.libreoffice.org/21250 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-01-08vcl: move filter headers to vcl/inc/filterChris Sherlock
Change-Id: I0b2b12d3f5cc6e35b2d87adb39ad44ba287c9a01
2015-12-24loplugin:unusedfieldsNoel Grandin
Change-Id: I979592adb978c3757a1e54615021ee424a2e02bf Reviewed-on: https://gerrit.libreoffice.org/20892 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-18com::sun::star->css in vcl/Noel Grandin
Change-Id: Ifad76177673cf93746ba221838be80ff76fed228 Reviewed-on: https://gerrit.libreoffice.org/20032 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann
Change-Id: I05e89f9896170d4df3d1377549ea074f06b884a0
2015-10-15cppcheck:variableScopeNoel Grandin
Change-Id: I9b671637fbe0f32e695d22b74bfb40a39a9fe884 Reviewed-on: https://gerrit.libreoffice.org/19364 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-10-09clang-analyzer-deadcode.DeadStoresStephan Bergmann
nSxe, nSye were unused ever since WMFReader::GetPlaceableBound was introduced (seemingly, involving some copy/paste) in fa149f402b9222d361e79769933bc6c58101ddef "#98505# if there is no WinExt we try to calculate the extension instead of using (1/1) default which causes a crash on unix and linux" Change-Id: Ica6fb9ec1d25bd5314e73610eccef2a4df0c310f
2015-10-09clang-analyzer-deadcode.DeadStoresStephan Bergmann
Change-Id: Icef974fccdc487b8abef3b1200b0b34b7be703ec
2015-09-30Fix typosAndrea Gelmini
Change-Id: I33385f1395f428c14bf86eff9891b288ddc590de Reviewed-on: https://gerrit.libreoffice.org/18993 Reviewed-by: Joren De Cuyper <jorendc@libreoffice.org> Tested-by: Joren De Cuyper <jorendc@libreoffice.org>
2015-09-29coverity#1242704 Untrusted loop boundCaolán McNamara
Change-Id: Id8a80028ad00ec7ae79eaa9d877a1fef9f4d082c
2015-08-31check stream statusCaolán McNamara
Change-Id: I27bb289288d319a93201e9c3d703114924ca258c
2015-08-17Put Polygon from tools under tools:: namespaceNorbert Thiebaud
Polygon is one of these names that Clash with some system objects A similar work has been done earlier with PolyPolygon. Change-Id: Icf2217cb2906292b7275760f1a16be0e150312f5 Reviewed-on: https://gerrit.libreoffice.org/17789 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
2015-07-10fix potential hang hereCaolán McNamara
Change-Id: Id62cdb90420b9ccf4e98fc1af46c70db6ed60ee0
2015-07-10avoid endless loop with busted wmfCaolán McNamara
Change-Id: I104de360f2e861e959ad2dad434a768440877f6f
2015-06-17Replace boost::scoped_array<T> with std::unique_ptr<T[]>Takeshi Abe
This may reduce some degree of dependency on boost. Done by running a script like: git grep -l '#include *.boost/scoped_array.hpp.' \ | xargs sed -i -e 's@#include *.boost/scoped_array.hpp.@#include <memory>@' git grep -l '\(boost::\)\?scoped_array<\([^<>]*\)>' \ | xargs sed -i -e 's/\(boost::\)\?scoped_array<\([^<>]*\)>/std::unique_ptr<\2[]>/' ... and then killing duplicate or unnecessary includes, while changing manually m_xOutlineStylesCandidates in xmloff/source/text/txtimp.cxx, extensions/source/ole/unoconversionutilities.hxx, and extensions/source/ole/oleobjw.cxx. Change-Id: I3955ed3ad99b94499a7bd0e6e3a09078771f9bfd Reviewed-on: https://gerrit.libreoffice.org/16289 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-06-04convert B2DLineJoin to scoped enumNoel Grandin
Change-Id: I4fb8f2c9e2080e3aa542d2ccf838e6784baa8429
2015-05-28new clang plugin: loopvartoosmallNoel Grandin
Idea from bubli - look for loops where the index variable is of such size that it cannot cover the range revealed by examining the length part of the condition. So far, I have only run the plugin up till the VCL module. Also the plugin deliberately excludes anything more complicated than a straightforward incrementing for loop. Change-Id: Ifced18b01c03ea537c64168465ce0b8287a42015
2015-04-02loplugin:staticmethodsNoel Grandin
Change-Id: Ibf0c73ac17ec19ed672f66907db47057920babca