summaryrefslogtreecommitdiff
path: root/drawinglayer
AgeCommit message (Collapse)Author
2023-07-21tdf#152992: for Impress/Draw add horizontal hit tolerance for quick text editSarper Akdemir
Implements horizontal hit tolerance for quick text edit in Impress & Draw making it more forgiving. Previously it was required to click exactly on the glyph to get a direct text cursor. Refactors hittestprocessor2d so that it now supports pseudo per axis hit tolerance. i.e. underlying isInEpsilonRange hit check is still the same utilizing the larger tolerance of the two per axis tolerance, but the preliminary check that uses aPolygonRange.grow() and later aPolygonRange.isInside() now filters hit misses out with respect to the per axis hit tolerance. Utilizes hittestprocessor2d's new per axis tolerance to introduce hit tolerance for quick text edit, making it similar to TextEdit mode hit tolerance which only has horizontal tolerance. Fixes wrong use of BoundRect hit to determine text frame border hits. Which previously only made sense for TextFrame borders, and was mostly useless for shapes with text inside. Change-Id: I749e63752da05b01270bfcab2632c41879a848ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154640 Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2023-07-14tdf#154982 drawinglayer,svx,sw,vcl: PDF export: hell flys and shapes...Michael Stahl
... should be below their anchor paragraph in the structure tree. Refactor SwEnhancedPDFExportHelper (etc.) to use the new EnsureStructureElement()/InitStructureElement() functions instead of SetCurrentStructureElement() for the frames, and allow it for flys that don't have their anchor paragraphs created yet because the hell layer is exported before the document body. Change-Id: I1be3b54002e8196772e6f9d81dd0fd0c85b6e34b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154399 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-07-14tdf#154982 vcl: PDF Export: split BeginStructureElementMichael Stahl
... into 3 parts: EnsureStructureElement/InitStructureElement/BeginStructureElement So EnsureStructureElement and BeginStructureElement/EndStructureElement can be called multiple times for the same object, passing in a unique key and PDFExtOutDevData will only create the element once. InitStructureElement will be used exactly once for each object when its actual content is exported. In PDFExtOutDevData rely on the indexes being the same here and in PDFWriterImpl, because then only PDFExtOutDevData needs to maintain the map from key to index. Change-Id: Idea6e34627fe559038cf13cf01dafe84b759e3c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154357 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-07-14tdf#154982 drawinglayer: post-order traversal of ObjectInfoPrimitive2DMichael Stahl
For the signature line, the wrong alt-text is exported to PDF, because the cui/source/dialogs/signature-line.svg contains lots of "desc" elements, which are converted to ObjectInfoPrimitive2D, and currently these are applied after the ObjectInfoPrimitive2D for the SdrObject. So let's try to switch the order, fixes the bugdoc at least. Change-Id: I7b5f6f4e68a3421ab33d7780995080deb6cf2238 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154308 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-07-14tdf#156271: add dx shift on top of x positionXisco Fauli
Change-Id: I61263a7fec2ec8236221a10f8cb730899c878f5f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154403 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-07-11(related tdf#154777) drawinglayer: add BBox to Figure fallback of formsMichael Stahl
PAC3 complains if the BBox is missing. Change-Id: I2cd61b2d01b64ffe77f28c661a3bd6f713df134f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154283 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-07-06tdf#126382 Correct check for transparencyMaxim Monastirsky
Change-Id: I0664abae6f83736678108fab31dd119fae811054 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154082 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2023-06-30Corrective and refactoring changes in drawinglayer modulegilssonn
Correct and simplify comparison logic and use std::transform for vector assignment. Change-Id: Idc92137db6d4648547a410f2cfd7e26edc797370 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152842 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2023-06-29tdf#104877 Implement APNG blending modesParis Oplopoios
Change-Id: Ib7ce4d113ccaa4843b8332087ebe52ac3828180e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153556 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-06-29tdf#156066: Add support for feDropShadow filterXisco Fauli
Change-Id: I0b2772a7211efb91821853e3369cfc3a5ef6a932 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153727 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-06-27MCGR: tdf#155479 always propagate SVG-flag for sub-content metafilesArmin Le Grand (allotropia)
For SVG export it is necessary to always propagate the SVG-flag for metafiles in *any* case impDumpToMetaFile is used and a new metafile gets created (aContentMetafile here). This is due to the subContent again may have any combinations of gradients/transparenceGradients that are non-vcl-renderable and need special handling. Change-Id: I7edee8afa81c0b6f3fb0e183d144c50f29c5bb79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153645 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-06-27loplugin:stringstatic look for more stringsNoel Grandin
that can be initialised at compile-time instead of runtime Change-Id: I08d516fdc13a3a79f93c079f89ac44cbc7a1ed71 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153620 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-26new loplugin:constexprliteralNoel Grandin
OUStringLiteral should be declared constexpr, to enforce that it is initialised at compile-time and not runtime. This seems to make a different at least on Visual Studio Change-Id: I1698f5fa22ddb480347c2f4d444530c2e0e88d92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153499 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-15speed up startup timeNoel Grandin
by avoid conversion of static locale data from sal_Unicode to OUString data - we can declare the data as OUStringConstExpr arrays and then no conversion is necessary. Here we trigger a problem - EditDLL has static data that tends to get torn down __after__ the i18npool shared library has been removed from memory, which means it tries to access OUStringLiteral objects that no longer exists. So use vcl::DeleteOnExit to explicitly clear that on application shutdown. Change-Id: Ie4bfcef7eb4656316ea825474ac42f85844d1dcc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153060 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-14tdf#155735: Add support for saturate typeXisco Fauli
Add getModifierName to BColorModifier class so when can assert which modifier is being used Change-Id: I2bc2a36470a449df4dc84a8440f232149c1f8278 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153048 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-06-13tdf#143877 Fix failing tests caused by floating point precisionBartosz Kosiorek
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-09Fix typoAndrea Gelmini
Change-Id: I4f3f148956c0502a3582a232cbd3cad287c0eaa1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152787 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-06-09MCGR: tdf#155479 repair gradient SVG export for MCGRArmin Le Grand (allotropia)
Unfortunately SVG export is based on metafiles and thus there is (in principle) no way to get the BGradient/ColorStop/MCGR data transfered as needed. For that, using UNO API to read the model or using B2DPrimitives would help - as is better for the export respectively. Since there is not the time to re-design SVG export I added this 'compromize' as a fix. It gets the needed data transported over the metafile (that part is the compromize). It then exports the MCGR data to SVG (at least - as was already there - if it's a linear/axial gradient). This happens now with all Gradient Stops when there is a MCGR gradient. That part is/will hopefully be re-usable if SVG export gets redesigned. I also added a handling for StepCount feature, so when used (in LO, others do not have that) 'hard' color stops get generated to make the gradient look identical for SVG export. Had to make adding of that extra-information in metafiles dependent on exporting really to SVG. There are 51 cases which use 'MetaActionType::COMMENT' which would potentially have to be adapted. Also added code to solve the problem for TransparencePrimitive2D at VclMetafileProcessor2D::processTransparencePrimitive2D. This will now - also only for SVG export - directly create the needed MetaFloatTransparentAction and add additional MCGR information. This will be used on SVG export to write a 'Mask' as was done before. This is now capable of creating fill MCGR-Masks in the sense that any number of TransparencyStops will be supported. Change-Id: Ic6d022714eae96b8fbc09e60652851ac5799b757 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152623 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-06-07tdf#155376 partially convert SvCTLOptions to officecfgNoel Grandin
When accessibility is enabled, Calc will add tens of thousands of listeners. We then spend a significant chunk of time creating SvCTLOptions objects (attached to ImpEditEngine) and adding and removing those objects from the related listener lists. But the required information is already globally cached by the officecfg module, so we can avoid that overhead and just fetch it directly from officecfg. Change-Id: I7ff55fd7c4926866eb7086812275ba8bd6e84c75 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152645 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-07tdf#132246: add basic support for feGaussianBlurXisco Fauli
for now only apply it if in="SourceGraphic" is explicitly used Change-Id: I3daea354f61ba5f6b3d13da1e7a71e99d51f6729 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152684 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-06-01tdf#143877 EMF+ Implement EmfPlusDrawCurve with cardinal splineBartosz Kosiorek
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-31Fix typoAndrea Gelmini
Change-Id: Ie108cc69cfd0d0e2837de3f1d38329f578866bd0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152461 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-05-31Fix typoAndrea Gelmini
Change-Id: I4b877a06c1fc09fa866c29dc39cb9478a50581b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152459 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-05-31Fix typoAndrea Gelmini
Change-Id: I0dfd64a270a2b669bceba435c2e01472ecf277f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152462 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-05-31MCGR: tdf#155437 handling of TransparencePrimitive2D for metafilesArmin Le Grand (allotropia)
In VclMetafileProcessor2D we need to take care of changed circumstances for gradients with the MCGR adaptions. The method processTransparencePrimitive2D tries to detect the special case that the trapsparency part of the handled TransparencePrimitive2D is a single TransparencyGradient. If detected, this is handed directly to vcl using a MetaFloatTransparentAction which contains a class 'Gradient', but the limited form from vcl (see include/vcl/gradient.hxx). This class can only in very limited scenarios directly handle/hold a gradient from the model (even before MCGR). For that case there is the helper method 'cannotBeHandledByVCL' that is already used to decide if limited direct rendering using vcl can be used. This has also be used here. Also reworked the conversion to Bitmap as needed, the existing versions created slight errors. For more details see additional comments in the code. Change-Id: If9af8b1423df5354eaf9ba8ca6243a1b3ad1b965 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152392 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-05-18improved B2DHomMatrixNoel Grandin
since we know that this is a matrix only used for 2D transforms, we know that the last row of the matrix is always { 0, 0, 1 }. Therefore, we don't need to store that information, and we can simplify some of the computations. Also remove operations like operator+ which are not legal for such a matrix. Change-Id: I482de9a45ebbedf79e3b6033575aab590e61c2d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151909 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-18Fix typoAndrea Gelmini
Change-Id: I7a79c2a4d145d1d847d71e5b36ccdb42278b06cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151946 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-05-16Fix typoAndrea Gelmini
Change-Id: I006c882aacf316dda0ecb3302835ca021d45ecc3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151812 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-05-16Fix typoAndrea Gelmini
Change-Id: I77c647c513c4b605917888bd9054385b2f7f7bf3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151814 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-05-16Fix typoAndrea Gelmini
Change-Id: I77c5760a38b07541eaceae765cd0e14eaddb6d11 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151818 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-05-16Fix typoAndrea Gelmini
Change-Id: Idce8a85c80c21ee4667810ec6f397389077432d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151810 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-05-16Fix typoAndrea Gelmini
Change-Id: Ib9150f390574dc9467335451f42a10749bd915d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151811 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-05-16Fix typoAndrea Gelmini
Change-Id: Id6f8a07f62e5861c4ad37b4537436632243b1a1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151809 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-05-15MCGR: consolidations/cleanups for changes so farArmin Le Grand (allotropia)
Change-Id: I85cf40e4803b0485bb40349d8e81adc8123666c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151706 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-05-09MCGR: Correct interpolate TextureMap due to possible zero valueArmin Le Grand (allotropia)
Change-Id: I5b2fe354077bea659f522e5b5c839be1f4cae1c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151568 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-05-08Avoid more division by zeroStephan Bergmann
Similar to <https://gerrit.libreoffice.org/c/core/+/151495> "Avoid division by zero", CppunitTest_sw_ooxmlexport7 CPPUNIT_TEST_NAME=testFdo78957::TestBody started to fail with > drawinglayer/source/texture/texture.cxx:470:71: runtime error: division by zero > #0 in drawinglayer::texture::GeoTexSvxGradientRadial::appendTransformationsAndColors(std::function<void (basegfx::B2DHomMatrix const&, basegfx::BColor const&)>) at drawinglayer/source/texture/texture.cxx:470:71 > #1 in drawinglayer::primitive2d::FillGradientPrimitive2D::generateMatricesAndColors(std::function<void (basegfx::B2DHomMatrix const&, basegfx::BColor const&)>) const at drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx:99:31 > #2 in drawinglayer::processor2d::VclPixelProcessor2D::processFillGradientPrimitive2D(drawinglayer::primitive2d::FillGradientPrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:1017:24 > #3 in drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:363:13 > #4 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21 > #5 in drawinglayer::processor2d::VclProcessor2D::RenderMaskPrimitive2DPixel(drawinglayer::primitive2d::MaskPrimitive2D const&) at drawinglayer/source/processor2d/vclprocessor2d.cxx:866:9 > #6 in drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:257:13 > #7 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21 > #8 in drawinglayer::processor2d::BaseProcessor2D::visit(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:56:13 > #9 in drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::get2DDecomposition(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&, drawinglayer::geometry::ViewInformation2D const&) const at drawinglayer/source/primitive2d/BufferedDecompositionPrimitive2D.cxx:41:14 > #10 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:46:24 > #11 in drawinglayer::processor2d::VclPixelProcessor2D::processPolyPolygonGradientPrimitive2D(drawinglayer::primitive2d::PolyPolygonGradientPrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:490:9 > #12 in drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:232:13 > #13 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21 > #14 in drawinglayer::processor2d::BaseProcessor2D::visit(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:56:13 > #15 in drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::get2DDecomposition(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&, drawinglayer::geometry::ViewInformation2D const&) const at drawinglayer/source/primitive2d/BufferedDecompositionPrimitive2D.cxx:41:14 > #16 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:46:24 > #17 in drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:378:13 > #18 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21 > #19 in drawinglayer::processor2d::BaseProcessor2D::visit(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:56:13 > #20 in drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::get2DDecomposition(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&, drawinglayer::geometry::ViewInformation2D const&) const at drawinglayer/source/primitive2d/BufferedDecompositionPrimitive2D.cxx:41:14 > #21 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:46:24 > #22 in drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:378:13 > #23 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21 > #24 in drawinglayer::processor2d::BaseProcessor2D::visit(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:56:13 > #25 in drawinglayer::primitive2d::GroupPrimitive2D::getChildren(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&) const at include/drawinglayer/primitive2d/groupprimitive2d.hxx:76:90 > #26 in drawinglayer::primitive2d::GroupPrimitive2D::get2DDecomposition(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&, drawinglayer::geometry::ViewInformation2D const&) const at drawinglayer/source/primitive2d/groupprimitive2d.cxx:53:13 > #27 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:46:24 > #28 in drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:378:13 > #29 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21 > #30 in drawinglayer::processor2d::VclProcessor2D::RenderTransformPrimitive2D(drawinglayer::primitive2d::TransformPrimitive2D const&) at drawinglayer/source/processor2d/vclprocessor2d.cxx:1004:5 > #31 in drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:284:13 > #32 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21 > #33 in drawinglayer::processor2d::VclProcessor2D::RenderTransformPrimitive2D(drawinglayer::primitive2d::TransformPrimitive2D const&) at drawinglayer/source/processor2d/vclprocessor2d.cxx:1004:5 > #34 in drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:284:13 > #35 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21 > #36 in drawinglayer::processor2d::VclProcessor2D::RenderTransformPrimitive2D(drawinglayer::primitive2d::TransformPrimitive2D const&) at drawinglayer/source/processor2d/vclprocessor2d.cxx:1004:5 > #37 in drawinglayer::processor2d::VclPixelProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) at drawinglayer/source/processor2d/vclpixelprocessor2d.cxx:284:13 > #38 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) at drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21 > #39 in drawinglayer::convertToBitmapEx(drawinglayer::primitive2d::Primitive2DContainer&&, drawinglayer::geometry::ViewInformation2D const&, unsigned int, unsigned int, unsigned int) at drawinglayer/source/tools/converters.cxx:217:24 > #40 in drawinglayer::convertPrimitive2DContainerToBitmapEx(drawinglayer::primitive2d::Primitive2DContainer&&, basegfx::B2DRange const&, unsigned int, o3tl::Length, std::optional<Size> const&) at drawinglayer/source/tools/converters.cxx:332:28 > #41 in SvxShape::GetBitmap(bool) const at svx/source/unodraw/unoshape.cxx:717:21 > #42 in SvxShape::getPropertyValueImpl(rtl::OUString const&, SfxItemPropertyMapEntry const*, com::sun::star::uno::Any&) at svx/source/unodraw/unoshape.cxx:2597:18 > #43 in SvxCustomShape::getPropertyValueImpl(rtl::OUString const&, SfxItemPropertyMapEntry const*, com::sun::star::uno::Any&) at svx/source/unodraw/unoshap2.cxx:1780:26 > #44 in SvxShape::_getPropertyValue(rtl::OUString const&) at svx/source/unodraw/unoshape.cxx:1638:14 > #45 in SvxShape::getPropertyValue(rtl::OUString const&) at svx/source/unodraw/unoshape.cxx:1622:16 > #46 in non-virtual thunk to SvxShape::getPropertyValue(rtl::OUString const&) at svx/source/unodraw/unoshape.cxx > #47 in SwXShape::_getPropAtAggrObj(rtl::OUString const&) at sw/source/core/unocore/unodraw.cxx:1823:23 > #48 in SwXShape::getPropertyValue(rtl::OUString const&) at sw/source/core/unocore/unodraw.cxx:1753:20 > #49 in non-virtual thunk to SwXShape::getPropertyValue(rtl::OUString const&) at sw/source/core/unocore/unodraw.cxx > #50 in writerfilter::TagLogger::unoPropertySet(com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> const&) at writerfilter/source/dmapper/TagLogger.cxx:123:47 > #51 in writerfilter::dmapper::DomainMapper_Impl::PushShapeContext(com::sun::star::uno::Reference<com::sun::star::drawing::XShape> const&) at writerfilter/source/dmapper/DomainMapper_Impl.cxx:4204:38 > #52 in writerfilter::dmapper::DomainMapper::lcl_startShape(com::sun::star::uno::Reference<com::sun::star::drawing::XShape> const&) at writerfilter/source/dmapper/DomainMapper.cxx:3680:18 > #53 in writerfilter::LoggedStream::startShape(com::sun::star::uno::Reference<com::sun::star::drawing::XShape> const&) at writerfilter/source/dmapper/LoggedResources.cxx:139:5 > #54 in writerfilter::ooxml::OOXMLFastContextHandlerShape::sendShape(int) at writerfilter/source/ooxml/OOXMLFastContextHandler.cxx:1810:19 > #55 in writerfilter::ooxml::OOXMLFastContextHandlerShape::lcl_endFastElement(int) at writerfilter/source/ooxml/OOXMLFastContextHandler.cxx:1829:9 > #56 in writerfilter::ooxml::OOXMLFastContextHandler::endFastElement(int) at writerfilter/source/ooxml/OOXMLFastContextHandler.cxx:223:9 > #57 in (anonymous namespace)::Entity::endElement() at sax/source/fastparser/fastparser.cxx:515:27 > #58 in sax_fastparser::FastSaxParserImpl::callbackEndElement() at sax/source/fastparser/fastparser.cxx:1330:17 > #59 in (anonymous namespace)::call_callbackEndElement(void*, unsigned char const*, unsigned char const*, unsigned char const*) at sax/source/fastparser/fastparser.cxx:339:18 > #60 in xmlParseEndTag2 at workdir/UnpackedTarball/libxml2/parser.c:9742:2 > #61 in xmlParseTryOrFinish at workdir/UnpackedTarball/libxml2/parser.c:11642:14 > #62 in xmlParseChunk at workdir/UnpackedTarball/libxml2/parser.c:12351:13 > #63 in sax_fastparser::FastSaxParserImpl::parse() at sax/source/fastparser/fastparser.cxx:1111:25 > #64 in sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) at sax/source/fastparser/fastparser.cxx:891:9 > #65 in sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) at sax/source/fastparser/fastparser.cxx:1469:13 > #66 in writerfilter::ooxml::OOXMLDocumentImpl::resolve(writerfilter::Stream&) at writerfilter/source/ooxml/OOXMLDocumentImpl.cxx:515:18 > #67 in writerfilter::dmapper::DomainMapper_Impl::substream(unsigned int, tools::SvRef<writerfilter::Reference<writerfilter::Stream>> const&) at writerfilter/source/dmapper/DomainMapper_Impl.cxx:9143:14 > #68 in writerfilter::dmapper::DomainMapper::lcl_substream(unsigned int, tools::SvRef<writerfilter::Reference<writerfilter::Stream>>) at writerfilter/source/dmapper/DomainMapper.cxx:4390:14 > #69 in writerfilter::LoggedStream::substream(unsigned int, tools::SvRef<writerfilter::Reference<writerfilter::Stream>>) at writerfilter/source/dmapper/LoggedResources.cxx:272:5 > #70 in writerfilter::ooxml::OOXMLDocumentImpl::resolveFastSubStreamWithId(writerfilter::Stream&, tools::SvRef<writerfilter::Reference<writerfilter::Stream>> const&, unsigned int) at writerfilter/source/ooxml/OOXMLDocumentImpl.cxx:126:13 > #71 in writerfilter::ooxml::OOXMLDocumentImpl::resolveHeader(writerfilter::Stream&, int, rtl::OUString const&) at writerfilter/source/ooxml/OOXMLDocumentImpl.cxx:385:10 > #72 in writerfilter::ooxml::OOXMLFastContextHandler::resolveHeader(int, rtl::OUString const&) at writerfilter/source/ooxml/OOXMLFastContextHandler.cxx:888:35 > #73 in writerfilter::ooxml::OOXMLHeaderHandler::finalize() at writerfilter/source/ooxml/Handler.cxx:214:20 > #74 in writerfilter::ooxml::OOXMLFastContextHandlerProperties::handleHdrFtr() at writerfilter/source/ooxml/OOXMLFastContextHandler.cxx:1113:28 > #75 in writerfilter::ooxml::OOXMLFactory_wml::endAction(writerfilter::ooxml::OOXMLFastContextHandler*) at workdir/CustomTarget/writerfilter/source/ooxml/OOXMLFactory_wml.cxx:7482:26 > #76 in writerfilter::ooxml::OOXMLFactory::endAction(writerfilter::ooxml::OOXMLFastContextHandler*) at writerfilter/source/ooxml/OOXMLFactory.cxx:157:19 > #77 in writerfilter::ooxml::OOXMLFastContextHandler::endAction() at writerfilter/source/ooxml/OOXMLFastContextHandler.cxx:316:5 > #78 in writerfilter::ooxml::OOXMLFastContextHandlerProperties::lcl_endFastElement(int) at writerfilter/source/ooxml/OOXMLFastContextHandler.cxx:1034:9 > #79 in writerfilter::ooxml::OOXMLFastContextHandler::endFastElement(int) at writerfilter/source/ooxml/OOXMLFastContextHandler.cxx:223:9 > #80 in (anonymous namespace)::Entity::endElement() at sax/source/fastparser/fastparser.cxx:515:27 > #81 in sax_fastparser::FastSaxParserImpl::callbackEndElement() at sax/source/fastparser/fastparser.cxx:1330:17 > #82 in (anonymous namespace)::call_callbackEndElement(void*, unsigned char const*, unsigned char const*, unsigned char const*) at sax/source/fastparser/fastparser.cxx:339:18 > #83 in xmlParseTryOrFinish at workdir/UnpackedTarball/libxml2/parser.c:11493:8 > #84 in xmlParseChunk at workdir/UnpackedTarball/libxml2/parser.c:12351:13 > #85 in sax_fastparser::FastSaxParserImpl::parse() at sax/source/fastparser/fastparser.cxx:1086:21 > #86 in sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) at sax/source/fastparser/fastparser.cxx:891:9 > #87 in sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) at sax/source/fastparser/fastparser.cxx:1469:13 > #88 in writerfilter::ooxml::OOXMLDocumentImpl::resolve(writerfilter::Stream&) at writerfilter/source/ooxml/OOXMLDocumentImpl.cxx:515:18 > #89 in (anonymous namespace)::WriterFilter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at writerfilter/source/filter/WriterFilter.cxx:208:24 > #90 in SfxObjectShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) at sfx2/source/doc/objstor.cxx:2272:34 > #91 in SfxObjectShell::DoLoad(SfxMedium*) at sfx2/source/doc/objstor.cxx:739:23 > #92 in SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sfx2/source/doc/sfxbasemodel.cxx:1940:36 > #93 in (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) at sfx2/source/view/frmload.cxx:720:28 > #94 in framework::LoadEnv::impl_loadContent() at framework/source/loadenv/loadenv.cxx:1176:37 > #95 in framework::LoadEnv::start() at framework/source/loadenv/loadenv.cxx:412:20 > #96 in framework::LoadEnv::startLoading(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, rtl::OUString const&, int, LoadEnvFeatures) at framework/source/loadenv/loadenv.cxx:308:5 > #97 in framework::LoadEnv::loadComponentFromURL(com::sun::star::uno::Reference<com::sun::star::frame::XComponentLoader> const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/loadenv/loadenv.cxx:168:14 > #98 in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/services/desktop.cxx:593:16 > #99 in non-virtual thunk to framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at framework/source/services/desktop.cxx > #100 in unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at unotest/source/cpp/macros_test.cxx:71:62 > #101 in UnoApiTest::load(rtl::OUString const&, char const*) at test/source/unoapi_test.cxx:115:11 > #102 in SwModelTestBase::loadURL(rtl::OUString const&, char const*, char const*) at sw/qa/unit/swmodeltestbase.cxx:470:20 > #103 in SwModelTestBase::load(char const*, char const*) at sw/qa/inc/swmodeltestbase.hxx:353:16 > #104 in SwModelTestBase::loadAndSave(char const*) at sw/qa/unit/swmodeltestbase.cxx:523:5 > #105 in testFdo78957::TestBody() at sw/qa/extras/ooxmlexport/ooxmlexport7.cxx:783:5 Change-Id: Ifbc7da0b6c971df61e9908cc02b10a9f50769fcf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151496 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-05-08Avoid division by zeroStephan Bergmann
bb198176684c3d9377e26c04a29ec66deb811949 "MCGR: Make MCGR default for oox im/export, cleanup" started to cause CppunitTest_chart2_geometry CPPUNIT_TEST_NAME=Chart2GeometryTest::testTdf128345Legend_CS_TG_axial_import to fail with the below UBSan failure (even though the relevant code appears to be even older than that commit). At least for now, lets silence that by explicitly using +INF in case the divisor is zero (and the dividend is known non-negative). > /drawinglayer/source/texture/texture.cxx:246:71: runtime error: division by zero > #0 0x7f2e61d80f7f in drawinglayer::texture::GeoTexSvxGradientLinear::appendTransformationsAndColors(std::function<void (basegfx::B2DHomMatrix const&, basegfx::BColor const&)>) /drawinglayer/source/texture/texture.cxx:246:71 > #1 0x7f2e616e187d in drawinglayer::primitive2d::FillGradientPrimitive2D::generateMatricesAndColors(std::function<void (basegfx::B2DHomMatrix const&, basegfx::BColor const&)>) const /drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx:75:31 > #2 0x7f2e616e4f4f in drawinglayer::primitive2d::FillGradientPrimitive2D::createFill(drawinglayer::primitive2d::Primitive2DContainer&, bool) const /drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx:172:17 > #3 0x7f2e616e66ca in drawinglayer::primitive2d::FillGradientPrimitive2D::create2DDecomposition(drawinglayer::primitive2d::Primitive2DContainer&, drawinglayer::geometry::ViewInformation2D const&) const /drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx:269:17 > #4 0x7f2e76cecd04 in drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::get2DDecomposition(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&, drawinglayer::geometry::ViewInformation2D const&) const /drawinglayer/source/primitive2d/BufferedDecompositionPrimitive2D.cxx:36:9 > #5 0x7f2e619b9278 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::BasePrimitive2D const&) /drawinglayer/source/processor2d/baseprocessor2d.cxx:46:24 > #6 0x7f2e61a38a25 in drawinglayer::processor2d::VclMetafileProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) /drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx:917:13 > #7 0x7f2e619b9a5f in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) /drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21 > #8 0x7f2e61a5cc3e in drawinglayer::processor2d::VclMetafileProcessor2D::processMaskPrimitive2D(drawinglayer::primitive2d::MaskPrimitive2D const&) /drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx:2139:13 > #9 0x7f2e61a3734a in drawinglayer::processor2d::VclMetafileProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) /drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx:833:13 > #10 0x7f2e619b9a5f in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) /drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21 > #11 0x7f2e619b952c in drawinglayer::processor2d::BaseProcessor2D::visit(drawinglayer::primitive2d::Primitive2DContainer const&) /drawinglayer/source/processor2d/baseprocessor2d.cxx:56:13 > #12 0x7f2e76ced03a in drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::get2DDecomposition(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&, drawinglayer::geometry::ViewInformation2D const&) const /drawinglayer/source/primitive2d/BufferedDecompositionPrimitive2D.cxx:41:14 > #13 0x7f2e619b9278 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::BasePrimitive2D const&) /drawinglayer/source/processor2d/baseprocessor2d.cxx:46:24 > #14 0x7f2e61a595e3 in drawinglayer::processor2d::VclMetafileProcessor2D::processPolyPolygonGradientPrimitive2D(drawinglayer::primitive2d::PolyPolygonGradientPrimitive2D const&) /drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx:2014:9 > #15 0x7f2e61a36fc0 in drawinglayer::processor2d::VclMetafileProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) /drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx:821:13 > #16 0x7f2e619b9a5f in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) /drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21 > #17 0x7f2e61a2e0da in drawinglayer::processor2d::VclMetafileProcessor2D::impDumpToMetaFile(drawinglayer::primitive2d::Primitive2DContainer const&, GDIMetaFile&) /drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx:244:5 > #18 0x7f2e61a60f4a in drawinglayer::processor2d::VclMetafileProcessor2D::processTransparencePrimitive2D(drawinglayer::primitive2d::TransparencePrimitive2D const&) /drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx:2292:52 > #19 0x7f2e61a378cb in drawinglayer::processor2d::VclMetafileProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) /drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx:851:13 > #20 0x7f2e619b9a5f in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) /drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21 > #21 0x7f2e619b952c in drawinglayer::processor2d::BaseProcessor2D::visit(drawinglayer::primitive2d::Primitive2DContainer const&) /drawinglayer/source/processor2d/baseprocessor2d.cxx:56:13 > #22 0x7f2e76ced03a in drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::get2DDecomposition(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&, drawinglayer::geometry::ViewInformation2D const&) const /drawinglayer/source/primitive2d/BufferedDecompositionPrimitive2D.cxx:41:14 > #23 0x7f2e619b9278 in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::BasePrimitive2D const&) /drawinglayer/source/processor2d/baseprocessor2d.cxx:46:24 > #24 0x7f2e61a38a25 in drawinglayer::processor2d::VclMetafileProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) /drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx:917:13 > #25 0x7f2e619b9a5f in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) /drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21 > #26 0x7f2e61a68781 in drawinglayer::processor2d::VclMetafileProcessor2D::processObjectInfoPrimitive2D(drawinglayer::primitive2d::ObjectInfoPrimitive2D const&) /drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx:965:5 > #27 0x7f2e61a38916 in drawinglayer::processor2d::VclMetafileProcessor2D::processBasePrimitive2D(drawinglayer::primitive2d::BasePrimitive2D const&) /drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx:910:13 > #28 0x7f2e619b9a5f in drawinglayer::processor2d::BaseProcessor2D::process(drawinglayer::primitive2d::Primitive2DContainer const&) /drawinglayer/source/processor2d/baseprocessor2d.cxx:68:21 > #29 0x7f2df2676731 in sdr::contact::ObjectContactOfPageView::DoProcessDisplay(sdr::contact::DisplayInfo&) /svx/source/sdr/contact/objectcontactofpageview.cxx:277:31 > #30 0x7f2df26741be in sdr::contact::ObjectContactOfPageView::ProcessDisplay(sdr::contact::DisplayInfo&) /svx/source/sdr/contact/objectcontactofpageview.cxx:117:21 > #31 0x7f2df291809d in SdrPageWindow::RedrawAll(sdr::contact::ViewObjectContactRedirector*) /svx/source/svdraw/sdrpagewindow.cxx:357:28 > #32 0x7f2df363584c in SdrPageView::CompleteRedraw(SdrPaintWindow&, vcl::Region const&, sdr::contact::ViewObjectContactRedirector*) /svx/source/svdraw/svdpagv.cxx:239:18 > #33 0x7f2df36a80b0 in SdrPaintView::DoCompleteRedraw(SdrPaintWindow&, vcl::Region const&, sdr::contact::ViewObjectContactRedirector*) /svx/source/svdraw/svdpntv.cxx:609:21 > #34 0x7f2df36a7b61 in SdrPaintView::CompleteRedraw(OutputDevice*, vcl::Region const&, sdr::contact::ViewObjectContactRedirector*) /svx/source/svdraw/svdpntv.cxx:522:5 > #35 0x7f2df3ec0413 in (anonymous namespace)::GraphicExporter::GetGraphic((anonymous namespace)::ExportSettings const&, Graphic&, bool) /svx/source/unodraw/UnoGraphicExporter.cxx:740:24 > #36 0x7f2df3ec857b in (anonymous namespace)::GraphicExporter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /svx/source/unodraw/UnoGraphicExporter.cxx:1037:19 > #37 0x7f2db53f082a in chart::ChartView::getMetaFile(com::sun::star::uno::Reference<com::sun::star::io::XOutputStream> const&, bool) /chart2/source/view/main/ChartView.cxx:263:20 > #38 0x7f2db53f1d43 in chart::ChartView::getTransferData(com::sun::star::datatransfer::DataFlavor const&) /chart2/source/view/main/ChartView.cxx:285:11 > #39 0x7f2db53f28ae in non-virtual thunk to chart::ChartView::getTransferData(com::sun::star::datatransfer::DataFlavor const&) /chart2/source/view/main/ChartView.cxx > #40 0x7f2db586547f in chart::ChartModel::getPreferredVisualRepresentation(long) /chart2/source/model/main/ChartModel.cxx:1054:44 > #41 0x7f2db586779e in non-virtual thunk to chart::ChartModel::getPreferredVisualRepresentation(long) /chart2/source/model/main/ChartModel.cxx > #42 0x7f2db8401589 in OCommonEmbeddedObject::getPreferredVisualRepresentation(long) /embeddedobj/source/commonembedding/visobj.cxx:186:48 > #43 0x7f2e95742555 in comphelper::EmbeddedObjectContainer::GetGraphicReplacementStream(long, com::sun::star::uno::Reference<com::sun::star::embed::XEmbeddedObject> const&, rtl::OUString*) /comphelper/source/container/embeddedobjectcontainer.cxx:1428:54 > #44 0x7f2e9573f6b4 in comphelper::EmbeddedObjectContainer::StoreAsChildren(bool, bool, bool, com::sun::star::uno::Reference<com::sun::star::embed::XStorage> const&) /comphelper/source/container/embeddedobjectcontainer.cxx:1198:31 > #45 0x7f2e044c7a1f in SfxObjectShell::SaveAsChildren(SfxMedium&) /sfx2/source/doc/objstor.cxx:3316:38 > #46 0x7f2e044c6d0c in SfxObjectShell::SaveAs(SfxMedium&) /sfx2/source/doc/objstor.cxx:160:12 > #47 0x7f2e0c509471 in sd::DrawDocShell::SaveAs(SfxMedium&) /sd/source/ui/docshell/docshel4.cxx:602:33 > #48 0x7f2e0453a4ec in SfxObjectShell::SaveAsOwnFormat(SfxMedium&) /sfx2/source/doc/objstor.cxx:3256:16 > #49 0x7f2e0c513d7d in sd::DrawDocShell::SaveAsOwnFormat(SfxMedium&) /sd/source/ui/docshell/docshel4.cxx:924:28 > #50 0x7f2e044f8b0c in SfxObjectShell::SaveTo_Impl(SfxMedium&, SfxItemSet const*) /sfx2/source/doc/objstor.cxx:1457:23 > #51 0x7f2e04534ef5 in SfxObjectShell::PreDoSaveAs_Impl(rtl::OUString const&, rtl::OUString const&, SfxItemSet const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sfx2/source/doc/objstor.cxx:2993:39 > #52 0x7f2e0452c40c in SfxObjectShell::CommonSaveAs_Impl(INetURLObject const&, rtl::OUString const&, SfxItemSet&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sfx2/source/doc/objstor.cxx:2783:9 > #53 0x7f2e04486556 in SfxObjectShell::APISaveAs_Impl(std::basic_string_view<char16_t, std::char_traits<char16_t> >, SfxItemSet&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sfx2/source/doc/objserv.cxx:319:19 > #54 0x7f2e046d7afe in SfxBaseModel::impl_store(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, bool) /sfx2/source/doc/sfxbasemodel.cxx:3151:42 > #55 0x7f2e046de8db in SfxBaseModel::storeToURL(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sfx2/source/doc/sfxbasemodel.cxx:1785:13 > #56 0x7f2dff75b078 in UnoApiTest::save(rtl::OUString const&, char const*) /test/source/unoapi_test.cxx:174:16 > #57 0x7f2e63063d61 in Chart2GeometryTest::testTdf128345Legend_CS_TG_axial_import() /chart2/qa/extras/chart2geometry.cxx:322:5 (<>https://ci.libreoffice.org//job/lo_ubsan/2766/) Change-Id: I72650fba2ee7ba339ec78d24dd690487c31e2600 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151495 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-05-07use AlphaMask for variables when calling GetAlphaMaskNoel Grandin
Right now this doesn't make any difference, since Bitmap is the superclass of AlphaMask. But when I switch to using alpha instead of transparency, passing AlphaMask around is going to mean something different to passing plain Bitmap around. Change-Id: Ic1541e5f0a3b97331793cd23e23115faa7f382b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151463 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-28Move all handling of AA allowing from svt to drawinglayerMike Kaganski
Commit 444bf8710d5da7b584fbcb94693e4ed8d2e29297 (Update handling of AntiAliasing settings and processor2d, 2022-11-08) moved the actual variable holding the AA state to drawinglayer, which introduced a duplication of the information. This moves all the handling from svt to drawinglayer, so that svt functions only use respective drawinglayer functions. Well, almost: the IsAAPossibleOnThisSystem function needs vcl, so stays in svt. Change-Id: I887307fbca1ca0cff1f5f32446e3599817099c3f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151163 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-04-27EMF+ tdf#103859 Optimize EmfPlusFillRects and EmfPlusDrawRectsBartosz Kosiorek
Change-Id: Iac96cf2d4291646fb69cc87c471d2f68ed905d69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151102 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2023-04-24EMF+ Minor optimization and clean up code of DrawBeziersBartosz Kosiorek
Change-Id: Id560b3d3a6182270853fd05a6f2d1e44452c0013 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150894 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2023-04-23tdf#154789 EMF+ Performance boost of the EmfPlusRecordTypeDrawBeziersBartosz Kosiorek
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-22tdf#154957 Revert "use OutputDevice clipping if its just a set of rectangles"Caolán McNamara
it was an attempt at an optimization, but if it doesn't work just revert it. The non-antialias case also doesn't work so the reverted commit wasn't itself the problem but the existing path has some flaw I'm not going to invest in figuring out. This reverts commit ee0d5e7bb8614c50e71dd074b8440f412eb62ff3. Change-Id: I8d4f126e3bfe135d39a085f28cea6708ae8f833f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150773 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2023-04-21MCGR: Reduce diverse GradientStyle enums to single UNO API oneArmin Le Grand (allotropia)
Change-Id: Ie0cd26a308a75ddead9451c53e874a39cc6eeb63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150705 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-04-18tdf#150020 pptx import: handle algn for outerShdwSarper Akdemir
Introduces RectangleAlignmentItem that holds a value of the enum model::RectangleAlignment. Introduces SDRATTR_SHADOWALIGNMENT that holds alignment for a shadow. Implements import of algn for outerShdw. Makes the alignment considered while the shadow is being scaled. Also adds a unit test that covers this. Change-Id: I8f4eaed5f0d9428a7f405c65f19237f9e70ca151 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148934 Tested-by: Jenkins Reviewed-by: Sarper Akdemir <sarper.akdemir@collabora.com>
2023-04-06tdf#152234 drawinglayer: PDF/UA export: fallback for unsupported formsMichael Stahl
veraPDF complains: Specification: ISO 14289-1:2014, Clause: 7.1, Test number: 3 Content shall be marked as Artifact or tagged as real content Form element can only be used for those form controls for which PDFWriterImpl can produce a Widget annotation; see createDefaultWidget(). For a label control, it's not editable so it's not a PDF widget. For an image button, it could be implemented in VCL but isn't currently. So a fallback is required in any case, "Figure" or "Div" can be used. Change-Id: I454030ff7c67a8a8101fcc59e945fe9dbc5f87a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150059 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-04-04MCGR: Improve performance for texture-mapped MCGR processingArmin Le Grand (allotropia)
Change-Id: I20b32e7c272112c6c3d9f7ee0ef59c6d4d006d94 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150020 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-04-04tdf#152234 vcl,drawinglayer: PDF/UA export: produce Role for form controlsMichael Stahl
veraPDF complains: Specification: ISO 14289-1:2014, Clause: 7.18.4, Test number: 2 If the Form element omits a Role attribute (Table 348), it shall have only one child: an object reference (14.7.4.3) identifying the widget annotation per ISO 32000-1:2008, 14.8.4.5, Table 340. LO forms produce both page content in an MCID and an /Annot, so Role is needed. Change-Id: Ic231931a7c35d8da37ca76e02d97501edb43347c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149626 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-04-02SDPR: Use currently added lambda to render GradientsArmin Le Grand (Allotropia)
Change-Id: I9fba920c60690f136cae956dae17e2f5e5081f19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149839 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-03-27tdf#152234 drawinglayer,svx: PDF/UA export: add Alt text to form controlsMichael Stahl
Specification: ISO 14289-1:2014, Clause: 7.18.1, Test number: 3 A form field whose hidden flag is not set and whose rectangle is not outside the crop-box shall have a TU key present or all its Widget annotations shall have alternative descriptions (in the form of an Alt entry in the enclosing structure elements) Form controls are weird because they have an SdrObject with the usual name/title/description plus a property "HelpText" on the control itself which is already exported as "/TU" on the /Annot unless it's empty. Exporting the SdrObject properties via ObjectInfoPrimitive2D doesn't work as tragically that is only created for form controls when painting to the screen while PDF export takes a detour that needs special handling. Change-Id: Id96f7dd13f190ab439c099cd1f4acb70c1c9fdc9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149554 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>