summaryrefslogtreecommitdiff
path: root/emfio
AgeCommit message (Collapse)AuthorFilesLines
2023-11-20Extended loplugin:ostr: emfioStephan Bergmann3-576/+620
Change-Id: Ida43018a83c68f5d20dbee30325b8f32099e5b1b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159713 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-31cid#1548365 Logically dead codeCaolán McNamara1-5/+0
since: commit c75cac85230d3899fe9f5f5086c117e4e1e5d330 Date: Sat Jun 17 02:57:42 2023 +0200 tdf#155887 WMF Fix displaying images with size of EOF other that 3 Change-Id: I326593cc556319d947bd9f3aef32b4ff6264c68f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158731 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-10-29tdf#155887 WMF Fix displaying images with size of EOF other that 3Bartosz Kosiorek3-12/+39
The size of W_META_EOF (record indicates the end of the WMF metafile) could be different than 3 (e.g. 6). The MS Office is allowing different sizes of EOF, and just properly finalizine parsing WMF file, and display its content. Original bug report: https://bz.apache.org/ooo/show_bug.cgi?id=42090 Change-Id: I21b72615c7f45fdca145e6240c6451d7d264d238 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153204 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2023-10-28tdf#155887 Add individual WMF records validationBartosz Kosiorek1-187/+283
In previous implementation, there was no proper validation of the records, by it's size. This commit adds validation of the WMF records. It would allow to interrupt reading, if wrong record found and play only records until it it correct. It will allow to mimic the behaviour of MS Office: If the wrong record is detected, the image is displayed till the wrong record. Currently in LibreOffice, if wrong record is found whole read is interrupted. Change-Id: I0c82deabcec7a416ca44540e693822f1986437eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153351 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2023-10-07loplugin:ostr: automatic rewriteStephan Bergmann1-3/+3
Change-Id: I2d09b2b83e1b50493ec88d0b2c323a83c0c86395 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157647 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
2023-10-06xmltesttools: add assertXPathDoubleValue that takes a double with deltaIlmari Lauhakangas1-13/+13
and use it to make WmfTest::testSetTextAlignWmf independent of DPI Change-Id: I2048239088a8dcc3e3ab1db96413894b5bcc56d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157377 Tested-by: Jenkins Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2023-09-08XEmfParser does not need to implement XAggreggationNoel Grandin1-2/+2
Checked on jenkins using 'make check' and + void SAL_CALL setDelegator(css::uno::Reference<css::uno::XInterface> const &) final { assert(false); } + Change-Id: I5ff6b1e166aff1ad67464785cf39d748f5dfc236 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156700 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-09use sal_uInt64 when dealing with stream positionNoel Grandin2-7/+7
Change-Id: I34a8ec2f69d9d58f8847e9cfb45937eae6159590 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155528 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-07-23tdf#156234: Don’t round glyph coordinates when doing subpixel positioningKhaled Hosny2-13/+13
When doing subpixel positioning (i.e. OutputDevice is in map mode), delay the rounding of the glyph coordinates after converting from pixel to logical units to minimize the loss of precision as much as possible. Some test expectations, expectedly, changes due to the improved positioning precision. Change-Id: I2591e3c7d4923ba7886a35bf53db759273354e24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154292 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: خالد حسني <khaled@libreoffice.org>
2023-07-21loplugin:redundantcast small improvementNoel Grandin1-1/+1
Change-Id: I2c96b367138b94d6178a3c4a0f83049f13a04f82 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154679 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-13tdf#143877 Fix failing tests caused by floating point precisionBartosz Kosiorek4-139/+124
Due to different imlementation of floating-point unit (FPU), on different CPU platforms, the floating point numbers could could be different. https://stackoverflow.com/questions/64036879/differing-floating-point-calculation-results-between-x86-64-and-armv8-2-a https://mcuoneclipse.com/2019/03/29/be-aware-floating-point-operations-on-arm-cortex-m4f/ With this path I have changed the tested images, to use floating point numbers which are easily represented by floating numbers (multiplied/divided by 2), like: - change tension to values: 0.125, 0.25, 0.5, 1.0, 1.5 ... - change position of curve to of control points to 256.0, 384.0 512.0 Previous values was hard to represent by floating numbers, for example tension: - 0.4 has been written as 0.399999976158142 - 0.1 has been written as 0.099999994039535 More information: https://observablehq.com/@benaubin/floating-point Additionally the precision of numbers were increased to double. Change-Id: I5725c1f2f474d0c00821edaa9bb2102cb172093f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152838 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2023-06-01tdf#143877 EMF+ Implement EmfPlusDrawCurve with cardinal splineBartosz Kosiorek3-26/+158
Change-Id: I98d30b2a8ba63fdddc08668f453c5f0feeb452db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152288 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2023-05-15ofz#58991 Heap-buffer-overflowCaolán McNamara1-1/+1
Change-Id: I44661cb2f9b2f44118140ae2fbcf86fe12cd282c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151760 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-05-13ofz#58928 Heap-buffer-overflow READCaolán McNamara1-0/+5
since: commit ba0bf0ab2c24d309e8a938cec26daa41eba9c8cf Date: Mon Mar 21 20:20:02 2022 +0100 tdf#142249 EMF Implement EMR_POLYDRAW record Change-Id: I9234a66d9f8691b9b051950b818884429b5f7277 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151728 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-05-12EMF Fix text aligning for EMR_SETTEXTALIGN for wrong values.Bartosz Kosiorek4-6/+99
Change-Id: I4d67eb7112d2295185905eac52ebab022a1beb78 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151670 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2023-05-12Related: ofz#58830 do Bezier point count checkCaolán McNamara1-2/+5
Change-Id: I1a7d7600563b57fb6dd9479b288d6fd3d4483059 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151710 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-05-11ofz#58830 Container-overflow READ 1Caolán McNamara1-0/+1
Change-Id: I7786a63c4cad8e4538b108a06551ff274a0ddcc6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151658 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-05-11ofz#58836 Out-of-memoryCaolán McNamara1-5/+5
Change-Id: I792bb179d2ac0133175e2690df6731fcb8bbbc15 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151659 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-05-10tdf#142249 EMF Implement EMR_POLYDRAW recordBartosz Kosiorek4-3/+115
The EMR_POLYDRAW record specifies a set of line segments and Bezier curves. Change-Id: I93d846d2fbb7a60b0565668a17ee092da30ef21c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151424 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2023-04-23tdf#154789 EMF+ Performance boost of the EmfPlusRecordTypeDrawBeziersBartosz Kosiorek2-0/+28
There is several benefits of such performance optimization: 1. We are drawing single curve instead of hundreds of small curves. In the loop we are creating single Polygon and outside of the loop we are invoking EMFPPlusDrawPolygon drawing method only once. As https://bugs.documentfoundation.org/attachment.cgi?id=186725 image is using single EmfPlusRecordTypeDrawBeziers EMF+ record with hundreds of curves, with using single EMFPPlusDrawPolygon call, there is no lnger need for individual line creation (e.g. line color, weight, line caps, line joints, line dashes, etc.) - The PDF export performance without optimizations of the https://bugs.documentfoundation.org/attachment.cgi?id=186725: time ./instdir/program/soffice --headless --convert-to "pdf:writer_pdf_Export" --outdir ~ ~/Pobrane/problem.docx real 24m18,471s user 2m56,004s sys 1m37,816 - The PDF export performance with optimizations: real 0m37,527s user 0m37,004s sys 0m0,531s - With Libreoffice 7.5.2 from Ubuntu 22.04, the conversion was crashed. 2. The PDF export for document: https://bugs.documentfoundation.org/attachment.cgi?id=186725 was not working correctly for me. The original image is containing chart. Without optimization, the exported chart was empty. Current export is working correctly, and graph is visible. 3. The standard opening of the document from https://bugs.documentfoundation.org/attachment.cgi?id=186725 is now much faster. The zooming in, move image operations are also noticible faster. Change-Id: Ic77d4c20a462587bb5da4a4df757e30c5ca04fc9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150821 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2023-04-11CppunitTest_emfio_emf: use CPPUNIT_TEST_FIXTURE()Xisco Fauli1-141/+45
This suite is large enough so that avoiding the declaration/registration/definition of each test manually saves a lot of space. Change-Id: I476b58a1c45ed5c977ce71a92d172b7e2df93015 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150224 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-03-16tdf#143148: Use pragma once instead of include guardsUday Sharma2-10/+2
Change-Id: I6898acbf7c6c9de45bbfa6a32202acf302f92caa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146822 Tested-by: Jenkins Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2023-03-09Demultiplex test codeStephan Bergmann1-40/+73
It is so much easier to work with if a test failure's line number unambiguously points at the code's sole execution. (That is, test code is necessarily non- DRY.) Change-Id: I75919c55671348f6190e9e108e72e24ec18ce986 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148514 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-03-09Re-enable CppunitTest_emfio_wmf for --enable-mergelibsStephan Bergmann2-2/+2
It had originally been disabled by a037f6338c19e16bcbc0674214666a786872c59d "Disable CppunitTest_vcl_wmf_test under --enable-merglibs for now" because "the problems caused by that test having the vcl objects linked into both the test's library and the mergedlib (which the test's library links against) are just not manageable", which is no longer an issue at least since 29cdfa3fc337381e2529eaac2a551137ee8a1aaa "no need to statically link against the emfio library in the tests". But the test code apparently uses WinMtfFontStyle, which can thus no longer be hidden under --enable-mergelibs. Change-Id: Ie807b19f0cb44408c69d03faca01fabe88239ca0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148493 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-02-15ofz: Use-of-uninitialized-valueCaolán McNamara1-6/+8
since: commit bbdbe8ea2ef176ef6f08b30b3c18876c2c4f0c22 Date: Fri Feb 3 22:55:54 2023 +0100 tdf#142018 Properly create Pen width if style is COSMETIC Change-Id: I739932e7bbf427a72bf16a771c20b6bd5596da5f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147041 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-02-11tdf#142018 Properly create Pen width if style is COSMETICBartosz Kosiorek3-31/+43
Change-Id: I6453058c4af352a3b0e14cbccbc1a67c73cd1426 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146551 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2023-01-12drop internal support for 1-bit imagesNoel Grandin1-3/+3
on modern hardware, these are less efficient than regular alpha channels. Also, this greatly simplies the range of stuff that vcl needs to deal with, which will make the upcoming transparency->alpha patch easier to deal with. Enhance vcl::CreateFromData to convert incoming 1-bit data to 8-bit image. Change-Id: I35829da750029fe373d0d2911a669d10bab6ad23 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145321 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-12-13tdf#152435 Revert "Make EMR_SAVEDC not UpdateClipRegion"Paris Oplopoios2-9/+7
This reverts commit 1230b88055c7389d2c376c316f91549e4aaef8aa. Reason for revert: The reverted commit breaks the files documented in tdf#152435 (some text is not shown in those .EMF files). The reverted commit would solve an issue where some text was not clipped correctly, albeit in a naive way. As it is more important that text is shown rather than some text having correct clipping, that patch is reverted and I will look for one that fixes both cases. Change-Id: I42e85b802b8bf1e77e96f0016cd1d83201047032 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143970 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-12-02tdf#152094 retain more accuracy from RefDevMode::MSO1Caolán McNamara4-15/+14
do it like this to avoid adding another mapmode and to keep things "the same" as much as possible Change-Id: I1965aa545646f2d27b950d6335b2f608c3e4e04b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143475 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-11-11Revert useless std::move of const objectStephan Bergmann1-1/+1
...added with f71606c920a3f78294da745cd9ef1eacde010224 "new loplugin:moveit". (I came across this code with an upcoming loplugin:constmove that flags suspicious uses of std::move involving const-qualified types.) Change-Id: If9c79d9a838fab5efbb55cb89b27b87f7e7ccd76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142562 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-11-08tdf#143148 Use pragma once instead of include guardsHarshita Nag1-4/+1
Change-Id: I8a91edb86edd76b70648507f12b18d9e923ab16e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141774 Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Tested-by: Jenkins
2022-11-08Make EMR_SAVEDC not UpdateClipRegionParis Oplopoios2-7/+9
EMR_SAVEDC would call UpdateClipRegion which would break the clip region sometimes before drawing the text causing it to not be clipped This line was introduced in a i#964 related patch (https://bz.apache.org/ooo/show_bug.cgi?id=964) The document in that test seems to render the same and the test file from the changed test renders the same also before and after this patch Change-Id: Id515b90efc9e533e18a35030a9a677de4d4ea02d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142272 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-11-08tdf#151844 Make EMR_EXTSELECTCLIPRGN factor in WinOrg coordinatesParis Oplopoios4-4/+29
EMR_EXTSELECTCLIPRGN would not factor in WinOrg coordinates which would give the clip box wrong coordinates causing some graphics to look chopped in the wrong way. Change-Id: I4f9a1b1c27fc276d188d0d865991795dab48dce5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142110 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-11-05-Werror,-Wdeprecated-declarations (sprintf, macOS 13 SDK): emfioStephan Bergmann2-2/+4
Change-Id: Id69f3639cb957570c4165150b288397c6e06727e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142324 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-11-03UnoApiXmlTest: add new wrapper for XmlTestTools testsXisco Fauli1-4/+3
Change-Id: I767f464ec666330a2e8e832b6d6f5736a6bef54d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142228 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-11-01CppunitTest_emfio_emf: inherit from UnoApiTestXisco Fauli2-25/+9
Change-Id: If1278f336aaff56a4378dcc1f0f95e0a749b629d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142099 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-10-25cid#1516423 Uninitialized scalar fieldCaolán McNamara1-0/+1
Change-Id: If60dfb726ba42bcb96a2d218bb81cb700f4c71f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141805 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-10-24tdf#150888 Scale down PPI if it would result in a tiny imageParis Oplopoios4-4/+44
The reason for the blurry document in tdf#150888 is that the image is tiny. PPI is 2540 in that image but when using the window bounding box (96, 81) this results in a very small image that the .odt then scales up which makes it blurry. Apart from that, when opening the extracted .wmf in Draw it's also very small, around 0.04" squared. Because MM_ANISOTROPICs definition allows for arbritrary scaling, when an image would be smaller than an inch squared the PPI is scaled down to either the images width or height. This makes the extracted WMF match the size of competitor office suites and fix the blur bug without breaking past tests. Change-Id: I11eab879848d9308f818708a91fd9eb91fc65200 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141533 Tested-by: Jenkins Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-09-08Rework of SoftEdgePrimitive2DArmin Le Grand (allotropia)1-5/+11
This is pretty much the same for SoftEdgePrimitive2D as the change for GlowPrimitive2D, so for more comments please refer to commit c2d1458723c66c2fd717a112f89f773226adc841 Added suggested change of DoSaveForVisualControl mechanism Change-Id: I28901e7a0b6e1823000d2aa6a335ce2fd80e6ce3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139585 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-08-24tools: rename Rectangle::Justify() to Rectangle::Normalize()Chris Sherlock2-5/+5
Jusify() normalizes the rectangle so both the Width and Height are positive, without changing the location of the rectangle. It ensures that the x and y coordinates will be moved to the top left of the rectangle. The name is strange, so renaming Justify() to Normalize(). Change-Id: Idbf163e65e52a798e38f785b8961b8042cf0cf2a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137379 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-08-18loplugin:moveitNoel Grandin1-2/+2
Change-Id: I34de7408553e4ca702cab9aa611c03dc60b9b6a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138472 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-14tdf#104921: Cleanup Kashida insertion logicKhaled Hosny1-2/+2
Communicate Kashida insertion positions in an explicit way. Rest of LibreOffice communicate adjustments to character widths (e.g. for justification or spacing) using so-called DX array. DX array is an array of absolute character positions (e.g. DX[n] is the position after character n from the start of the lines, and its widths is DX[n] - DX[n-1]). This DX array is modified also when Kashidas are inserted after a given character for Arabic justification, by expanding its width. VCL would use this to know where to insert the Kashidas and how many ones. But because DX array is used for both widths adjustments and kashida insertion, this turns out to be a source of bugs since VCL has tosecond guess the DX array to find which is pure width adjustment and which also involves Kashida insertion, and the heuristics it uses are fragile. This change adds a second array of booleans that records where Kashida is inserted and communicates it all the way from where Kashida insertion is decoded in Writer and down to VCL layout. This change passes the Kashida array only when it seems necessary (e.g. during drawing but not when measuring text since the DX array is enough in this case). Hopefully no places where Kashida insertion needs to be passed down were missed. A couple of glyph and layout flags that were used for old heuristics and no longer needed and are removed. This also fixes: tdf#87731 tdf#106309 tdf#108604 tdf#112849 tdf#114257 tdf#127176 tdf#145647 tdf#146199 Change-Id: I4ed0850ef2fdc3e9143341afac649e7e7d463c39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138068 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-13clang-tidy modernize-pass-by-value in variousNoel Grandin1-3/+4
Change-Id: Ie091b22bd77d4e1fbff46545bc86c12f1dbafcfe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138171 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-25loplugin:moveitNoel Grandin1-2/+2
make the plugin more conservative, so we see less false+ (although we also miss some possibilities in the process) Change-Id: I91b1806271e7f802d7459834ab7bcc569047da3a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137342 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-19Replace old png writer in emfreader.cxxofftkp1-3/+3
Change-Id: Ibc3ed62d5d09d2da9d7866deb21f49340ba71eea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137117 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-07-14loplugin:moveitNoel Grandin1-1/+1
Change-Id: I2702e716dc669ffbb870d36d060e110288d7a744 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137043 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-08Make TestEmfPlusDrawPathWithCustomCap succeed on Aarch64Stephan Bergmann2-1/+1
CppunitTest_emfio_emf CPPUNIT_TEST_NAME=Test::TestEmfPlusDrawPathWithCustomCap introduced in 5b21b65572610df88986e700b81f1156aff14f65 "tdf#142770 tdf#143031 EMF+ Implement CustomLineCap" failed for me both in a local master build on macOS on Apple M1 and in a Linux aarch64 test build of the libreoffice-7.4.0.1 Flathub flatpak (at <https://buildbot.flathub.org/#/builders/21/builds/7749>) with > xmltesttools.cxx:195:Assertion > Test name: (anonymous namespace)::Test::TestEmfPlusDrawPathWithCustomCap > equality assertion failed > - Expected: 1423.297394625,1268.98481214025 830.006276132353,558.656004112967 > - Actual : 1423.297394625,1268.98481214025 830.006276132352,558.656004112967 > - In <>, XPath contents of child does not match As this failed in exactly the same way for rather different builds (Clang vs. GCC; Apple M1 vs. whatever ARM processor used by <https://flathub.org/builds>), it smells like the test input might trigger a case where operations can legitimately produce slightly different floating point results, which would then cause the test to erroneously fail for some builds. So I hacked the test input emfio/qa/cppunit/emf/data/TestEmfPlusDrawPathWithCustomCap.emf slightly, making the EmfPlusPath's 2nd EmfPlusPointF Y coordinate identical to the 1st one's, so that the arrow now points west rather than north-west, > 00000190: 02 10 c0 db 00 00 00 00 00 00 cc ff 08 40 0e 03 > 000001a0: 2c 00 00 00 20 00 00 00 02 10 c0 db 02 00 00 00 > 000001b0: 00 00 00 00 2b b5 05 45 05 54 56 45 d6 66 00 45 > -000001c0: 05 54 56 45 00 01 81 01 15 40 0e 00 10 00 00 00 > +000001c0: 51 23 4d 45 00 01 81 01 15 40 0e 00 10 00 00 00 > 000001d0: 04 00 00 00 0f 00 00 00 0e 00 00 00 14 00 00 00 > 000001e0: 00 00 00 00 10 00 00 00 14 00 00 00 which happens to let the test compute a different polygonstrokearrow/polygon value now, but which appears to be stable across at least my x86-64 and aarch64 test builds. And temporarily reverting the non-test (i.e., drawinglayer) parts of 5b21b65572610df88986e700b81f1156aff14f65 would make the test fail with > xmltesttools.cxx:121:Assertion > Test name: (anonymous namespace)::Test::TestEmfPlusDrawPathWithCustomCap > assertion failed > - Expression: xmlXPathNodeSetGetLength(pXmlNodes) > 0 > - In <>, XPath '/primitive2D/metafile/transform/polygonstrokearrow/polygon' not found so the test appears to still faithfully check the intended difference in behavior. Change-Id: Iec31246dd7666ec764176622ccc4f246eea6e4ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136896 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-06-27tdf#142770 tdf#143031 EMF+ Implement CustomLineCapBartosz Kosiorek2-0/+26
Change-Id: I9fae1d259ecdca37a1babac8a8a0e503b2dc0118 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135960 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2022-06-14tdf#131506 tdf#143031 EMF+ Fix displaying PathGradient fillBartosz Kosiorek2-0/+23
With previous implementation, the EMF+ import is calculating gradient positions wrongly. It is causing warning: SvgGradientHelper got invalid SvgGradientEntries outside [0.0 .. 1.0] and the gradient was not displayed at all. This patch fixes that and gradient is displayed correctly Change-Id: I6229c516165436d0c7ae187d9eb69b5494da396f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135607 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2022-06-10new loplugin:moveitNoel Grandin3-10/+10
look for local variables that can be std::move'd to parameters off by default, since it doesn't do proper data flow analysis Change-Id: I3403a0fcffd165bdea6a772528bc53995c5fdb40 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135527 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>