diff options
author | Balazs Varga <balazs.varga.extern@allotropia.de> | 2025-01-15 09:53:15 +0100 |
---|---|---|
committer | Balazs Varga <balazs.varga.extern@allotropia.de> | 2025-01-20 14:47:05 +0100 |
commit | 0e01a536d8173270d6a4545a861c2b0b1ba4db17 (patch) | |
tree | 89e62a7ddafa0e96ea9fd5cbf7624630a440b028 /sd | |
parent | 1552102dd32cfa76a8b5b5c083be8921871941af (diff) |
tdf#164622 - SVG: fix broken cropped svg files at metafile export
For creating metafile, there mask polygon from MaskPrimitive2D needs to be closed.
Otherwise later during the metafile export the we will skipp the rendering of the
last points of the polylines.
SVG clipping paths: "A clipping path is a set of closed vector path that may consist
of an arbitrary number of straight and curved segments."
Change-Id: I21487a81b904ec7ec5c6bd2a89b7539aeb86d606
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180278
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Tested-by: Jenkins
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/pptx/tdf164622.pptx | bin | 0 -> 18696 bytes | |||
-rw-r--r-- | sd/qa/unit/layout-tests.cxx | 34 |
2 files changed, 34 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf164622.pptx b/sd/qa/unit/data/pptx/tdf164622.pptx Binary files differnew file mode 100644 index 000000000000..2f766518cc11 --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf164622.pptx diff --git a/sd/qa/unit/layout-tests.cxx b/sd/qa/unit/layout-tests.cxx index 57baf576c8c5..6fae40d135c7 100644 --- a/sd/qa/unit/layout-tests.cxx +++ b/sd/qa/unit/layout-tests.cxx @@ -424,6 +424,40 @@ CPPUNIT_TEST_FIXTURE(SdLayoutTest, testTdf152906_AdjustToContour) } } +CPPUNIT_TEST_FIXTURE(SdLayoutTest, testTdf164622) +{ + xmlDocUniquePtr pXmlDoc = load("pptx/tdf164622.pptx"); + + // Without the fix, the test fails with: + // - Expected: 8998 + // - Actual : 892 + // - In <>, attribute 'y' of '/metafile/push[1]/push[1]/push[2]/push[1]/clipregion/polygon/point[4]' + assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[2]/push[1]/clipregion/polygon/point[1]", + "x", u"7556"); + assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[2]/push[1]/clipregion/polygon/point[1]", + "y", u"892"); + + assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[2]/push[1]/clipregion/polygon/point[2]", + "x", u"20440"); + assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[2]/push[1]/clipregion/polygon/point[2]", + "y", u"892"); + + assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[2]/push[1]/clipregion/polygon/point[3]", + "x", u"20440"); + assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[2]/push[1]/clipregion/polygon/point[3]", + "y", u"8998"); + + assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[2]/push[1]/clipregion/polygon/point[4]", + "x", u"7556"); + assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[2]/push[1]/clipregion/polygon/point[4]", + "y", u"8998"); + + assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[2]/push[1]/clipregion/polygon/point[5]", + "x", u"7556"); + assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[2]/push[1]/clipregion/polygon/point[5]", + "y", u"892"); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |