summaryrefslogtreecommitdiff
path: root/emfio
AgeCommit message (Collapse)Author
2021-09-07ofz: MemorySanitizer: use-of-uninitialized-valueCaolán McNamara
Change-Id: I4c88389de1a7f6cf4ceac278b264a0ec71fba86d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121747 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-06ofz: MemorySanitizer: use-of-uninitialized-valueCaolán McNamara
Change-Id: I4a96b4e687f57ee38686dc03d87ba29de3ec0e98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121708 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-05ofz: MemorySanitizer: use-of-uninitialized-valueCaolán McNamara
Change-Id: Ib8b337609afa4f588878a1e08eb74fca28fc0534 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121666 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-05Simplify a bit nOldROP management (emfio/wmfreader)Julien Nabet
Change-Id: Ia50f9def88e8435fb5ce3267cbd3fdfcaa72ef4b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121646 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-09-04ofz: MemorySanitizer: use-of-uninitialized-valueCaolán McNamara
Change-Id: I53383a71b4a362409773f8f1123982e8d2c5a324 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121631 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-04use std::vector for fetching DX array dataNoel Grandin
because I'm trying to track down a related heap corruption, and that is much easier if the access to the array is checked by the std::vector debug runtime Change-Id: Ia665f5cebb7f14d88942e88b4b400ad3c28ef5d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121527 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-03ofz: MemorySanitizer: use-of-uninitialized-valueCaolán McNamara
Change-Id: I6546ef38c6e84193c00ea5fcac621fdec93e0ab7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121593 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-03ofz: MemorySanitizer: use-of-uninitialized-valueCaolán McNamara
Change-Id: I626eb1847484f7bc6af7eed45b891307718c5263 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121596 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-03ofz: MemorySanitizer: use-of-uninitialized-valueCaolán McNamara
Change-Id: I6cd0e9b518bf6f40e0221fd2e9f3c5fb6199e14f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121574 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-03ofz: MemorySanitizer: use-of-uninitialized-valueCaolán McNamara
Change-Id: I71d3b07c7ca2467b7bc1db5350dbdeb1f8910cb0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121478 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-03ofz: MemorySanitizer: use-of-uninitialized-valueCaolán McNamara
Change-Id: I3eaf680052ada10b6a6e8fded6e806d6045d0fac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121538 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-03ofz: MemorySanitizer: use-of-uninitialized-valueCaolán McNamara
Change-Id: I7cd46af148471de516860046c04f71b6ae5fea89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121522 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-03tdf#88163 Fix WMF font sizeHossein
The problems in tdf#88163 can be categorized into two parts: 1. A regression which is caused by the commit a9020e461803964a206d5551884b70717eed165c. The font size for text is wrongly calculated for wmf files WITHOUT the placeable header. 2. A long-lasting bug that has existed from LO 3.5 (tested with various LibreOffice versions from 3.5 to master). The font size for text is wrongly calculated for wmf files WITH the placeable header. This patch solves the first part. In this patch the way wmf is scaled is changed using mnUnitsPerInch as a variable that controls the scale. The previous method was dividing the left/right/top/bottom fields of aPlaceableBound which caused the bad scaling of text. The second problem still remains, and possibly can be solved by usign the old scaling method that was previously used here (dividing pos values of aPlaceableBound), but the scaling factor should be calculated, which varies in different wmf files. More study should be done to solve this part. Values used for the example "visio_import_source.wmf" used in the test WmfTest::testNonPlaceableWmf() are slightly changed, but the rendering should not noticeably change, except the fix for the text font size. A new test WmfTest::testTdf88163NonPlaceableWmf() is added which checks for both font height and text boxes' positions. Font height can depend on the exact font that is used for Roman in the platform, so it vary between Linux, Windows and macOS. Thus, a range is used for ensuring that the font height is correct. By visual inspection, it is confirmed that this fix does not affect fdo#74336 and the fix for it still works for attachment 93188. Change-Id: I55bf38ba4345a0aa48c3e522976a2a5c32f7ec8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121272 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-09-03no need to allocate BSaveStruct separatelyNoel Grandin
Change-Id: Id14f525e84c22caa8f974f2f1d9f398f8d8e2df8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121532 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-01ofz: MemorySanitizer: use-of-uninitialized-valueCaolán McNamara
Change-Id: Idaeb060e54fcb401f483abeb17e4f40dfd7ae20d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121374 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-01ofz: MemorySanitizer: use-of-uninitialized-valueCaolán McNamara
Change-Id: Ia1e6d4c71d4bd228f2a9bb5fd2f5dbf54b94700d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121396 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-09-01ofz: MemorySanitizer: use-of-uninitialized-valueCaolán McNamara
Change-Id: I9e7be23fd8a52cfd0976ca358d848cbe11e84c2b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121355 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-08-31ofz: MemorySanitizer: use-of-uninitialized-valueCaolán McNamara
Change-Id: I40ab9dc8b320990abcf89630984892e040a8544d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121380 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-08-31ofz: MemorySanitizer: use-of-uninitialized-valueCaolán McNamara
test for eof condition before comparing the uninit val Change-Id: Ie27c80f6c8103af4283181c522794eb878ccf588 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121373 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-08-31ofz: MemorySanitizer: use-of-uninitialized-valueCaolán McNamara
Change-Id: Ie08cae55b638be5756d801b10b4546eb6c985f7a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121379 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-08-31clang-tidy:readability-redundant-member-initNoel Grandin
Change-Id: Icaef0cca9ca7bce76a7eb7ecd54c492f9ffcaad6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121376 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-31ofz: MemorySanitizer: use-of-uninitialized-valueCaolán McNamara
Change-Id: I3244f5c83a02f41ec379188b1fedbdd9e511967c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121318 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-08-30ofz: MemorySanitizer: use-of-uninitialized-valueCaolán McNamara
Change-Id: Iccdfb92beae8d79863d1bca3dc44c1a13bf30a67 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121299 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-08-30ofz: MemorySanitizer: use-of-uninitialized-valueCaolán McNamara
Change-Id: Ibeeef815afea9bee3cdf6b6de17de4f836b00351 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121223 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-08-29ofz: MemorySanitizer: use-of-uninitialized-valueCaolán McNamara
Change-Id: I6d01c819766520eb5c0a8190fa2e9f6f99006548 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121220 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-08-29ofz: MemorySanitizer: use-of-uninitialized-valueCaolán McNamara
Change-Id: I4a34981e6597743f9f3a9ad6ca063cb347a68d14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121212 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-08-18loplugin:constparamsNoel Grandin
Change-Id: Ic7410f836e584df45101e78e345c8b3c8d355e09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120680 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-08-18undo changes to TextAlignCaolán McNamara
revert commit 8689bd5490b473a7ffb149bbe5f7f0683f679c72 Author: Caolán McNamara <caolanm@redhat.com> Date: Thu Jul 29 20:49:29 2021 +0100 convert TextAlign to scoped enum lets leave this as it always was Change-Id: Id4d2a5644974cdd2b0ed6d361d5c52629674d057 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120626 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-07-30convert TextAlign to scoped enumCaolán McNamara
Change-Id: Id2c466eacb44f0ea6adba75a0ac0be8be8e7ed4c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119682 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-07-25ofz#36481 TimeoutCaolán McNamara
Change-Id: I0de9bf0a8b83af83ba31bdb75497e13ada4f7f4c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119480 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-07-13Enable automatic code style formatting for EmfImportTest.cxxBartosz Kosiorek
As EmfImportTest.cxx code style is follow the recommended code style (except too long lines), the code is used only for testing and it is rarely modified, I decided to enable automatic code formatting. It is one step closed to migrate to common code style. Change-Id: I1b7f980b9e68e121ba981b8a8222daa31424ac53 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118864 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-07-13Decrease line length of EmfImportTest.cxx by introducing const stringBartosz Kosiorek
Change-Id: Ie30d0246d6ca54821f00fe516ab67f803ef0d804 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118863 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-07-06CppunitTest_emfio_emf: add some tolerance in TestDrawStringAlignMiklos Vajna
Commit 574dc1e8ff6ea4214fefd91216fca5146a4ff13e (EMF+ tdf#142995 tdf#142997 tdf#143076 Add alignment support for DrawString, 2021-06-24) added this test, it seems the result depends on what fonts are installed, so add some tolerance. Probably it fails for me (and not on Jenkins) as I have lots of additional fonts installed, e.g. Arial (and not only Liberation Sans). Change-Id: Ie93d1f1efe1fbbf1851ad46f33f5f83c8812e6d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118470 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-07-03EMF+ tdf#142941 Fixes for SrcRect in DrawImagePointsBartosz Kosiorek
The SrcRect could be specified outside of source bitmap. In such cases the Destination bitmap should be displayed as shifted (eg. if position is negative), and scaled properly. Change-Id: Ied6d339703999faaae061802ef6a28e190d5a176 Change-Id: Ia9772ced282684c2c94a261d97d30b53921d6171 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118345 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-07-01EMF+ tdf#142995 tdf#142997 tdf#143076 Add alignment support for DrawStringBartosz Kosiorek
With this commit, real size of the text is used to make proper horizontal alignment. Additionally vertical alignment is added and fix for Center alignment was applied Change-Id: I17d9fd7de7f00f5e69f99c5b09061eb6059be67e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117794 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-06-23EMF+ tdf#142975 Add brush support to DrawString recordBartosz Kosiorek
Change-Id: Icfcb4199dcd755fb20e14a8166571b6d6e763f2e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117671 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-06-18Resolves: ofz#34920 allow displaying only one text stringBartosz Kosiorek
Change-Id: I8bc4ed015dfad4fd99ca8cfce7fca0e7b411edf3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117443 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-06-17EMF+ WMF Update the variable names and add additional TODO warningsBartosz Kosiorek
Change-Id: I78b05fe3c293494195bdd37c3030147b1f21228e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117148 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-06-11drop EMF+ also when converting WMF, not just EMFLuboš Luňák
A WMF may have EMF with EMF+ actions embedded. When we read that, we drop drawing non-EMF+ actions if we use EMF+. But EMF+ actions are stored as MetaCommentAction in the metafile, and WMF writer (unlike EMF) writer simply ignores comments. So when writing WMF, make sure to read non-EMF actions so that something is written. This is an extension of 295626a0bd39540544b774094a63df23e5376839. Change-Id: I37355f694fe656b661abe54274ea203934e68151 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117062 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2021-06-11EMF tdf#59814 tdf#142567 Align RestoreDC record with MSO implementationBartosz Kosiorek
Some of WMF and EMF behaviours are undocumented. In that case, we are implementing the behaviour, observed in MS Office or MS Paint. With this commit the behaviour of import EMF RestoreDC records, will be the same as for MS Paint and MS Office. Change-Id: I73b65d14018f2667ffd59daf16ecc6d7ce9c1870 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117052 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-06-11ofz#35150 crash in Bitmap::Crop from wmf loadCaolán McNamara
which is a problem since... commit 33d2cf7008de79106b5da4bba0241aa14d81d88f Date: Sat Jun 5 19:30:46 2021 +0200 WMF Change the sign of read fields in BITBLT and DIB records Change-Id: Iea1261a52866d691435f0612f672636009c00355 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117039 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-06-11ofz#35149 crash in vcl::bitmap::CreateFromData from wmf loadCaolán McNamara
which has started since... commit 01ded1e6d362dbcd7148334c6965d6ad00981d4a Date: Tue Jun 8 23:07:28 2021 +0200 WMF tdf#55058 tdf#142722 Add implementation of BitBlt and StretchBlt Change-Id: I5bbde55dbd9e239c05544ac4a21e2758770245d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117038 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-06-11WMF/EMF tdf#59814 tdf#142567 Fix RestoreDC recordBartosz Kosiorek
With previous implementation, the RestoreDC index argument was skipped, and always the last entry was taken. With this commit the support for reading SaveDC by specific index was added. The SaveDC/RestoreDC index support was added for both EMF and WMF, according to [MS-WMF] and [MS-EMF] documentation. Change-Id: I9b8a1a41462ae01de25ac3c85e453bcd80e05537 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117033 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-06-10EMF tdf#142745 Improve performance of FILLRGN, PAINTRGN, EXTSELECTCLIPRGNBartosz Kosiorek
With previous implementation, during reading of rectangles the optimizations were made after reading every single rectangle. This was causing performance issues, with many rectangles (eg. 2500 rectangles). With this commit, the optimization is made after reading all rectangles. It is improving performance of FILLRGN, PAINTRGN and EXTSELECTCLIPRGN records. Change-Id: I1b8b844efddd08e9bf6f6726c3fdf213a629883f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116996 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-06-09WMF tdf#55058 tdf#142722 Add implementation of BitBlt and StretchBltBartosz Kosiorek
With previous implementation, only BitBlt record with 1 bit color depth was supported and StretchBlt was not implemented at all. With this commit the support for 1 bit, 24 bit and 32 bit, for both BitBlt and StretchBlt were added. Change-Id: I061b2beae8c2f143ddff9c8c8bb64bf52f4cf502 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116873 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-06-08WMF tdf#142625 Refactor Bitmap records, to better handle missing featuresBartosz Kosiorek
Change-Id: If3334158e6e0ef9bc3aa33656ad0ee45cf460dbb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116827 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-06-07WMF tdf#142625 Continue read records if unimlemented features foundBartosz Kosiorek
Most of DIB records (DIBCREATEPATTERNBRUSH, STRETCHDIB) are implemented partially. If the unimplemted feature are inside WMF, then the whole reading steam is interrupted and nothing is displayed. With this commit if DIB record used missing feature, then the warning is displayed, and the displaying continue. The fix allows for displaying WMF image from tdf#55058 Change-Id: I6cc88d41486c52a2b1a6ec0b89166460a78ce7d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116763 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-06-05WMF Change the sign of read fields in BITBLT and DIB recordsBartosz Kosiorek
Additionally the names of variables were improved, and additional checks were added for unsupported cases Change-Id: Id84ef1218c5c2a40c8d01f2d40857d892badbb9f Change-Id: I1b8571d0a627827bc1e67c2bfc6c1932d58c5233 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116744 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2021-06-03ofz#34867 TimeoutCaolán McNamara
Change-Id: Ia07b8b4c41233c0f66239d2f37833ddecc0dd278 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116640 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-06-02WMF: add more SAL warnings in case record was not implementedBartosz Kosiorek
Change-Id: I1d58c4093817403caa5f1112b5d4d5a4e638b799 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116618 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>