summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx6
-rw-r--r--sd/qa/unit/data/pptx/tdf164622.pptxbin0 -> 18696 bytes
-rw-r--r--sd/qa/unit/layout-tests.cxx34
3 files changed, 40 insertions, 0 deletions
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 2658ed6410de..b39341f72612 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -2247,6 +2247,12 @@ void VclMetafileProcessor2D::processMaskPrimitive2D(
if (aMask.count())
{
+ // A clipping path is a set of closed vector path that may consist of an arbitrary number
+ // of straight and curved segments. The region(s) enclosed by the path define(s) the visible area,
+ // i.e. after applying a clipping path, only those portions of the subsequently drawn graphics that
+ // fall inside the enclosed area are visible, everything else is cut away.
+ if (!aMask.isClosed())
+ aMask.setClosed(true);
// prepare new mask polygon and rescue current one
aMask.transform(maCurrentTransformation);
const basegfx::B2DPolyPolygon aLastClipPolyPolygon(maClipPolyPolygon);
diff --git a/sd/qa/unit/data/pptx/tdf164622.pptx b/sd/qa/unit/data/pptx/tdf164622.pptx
new file mode 100644
index 000000000000..2f766518cc11
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf164622.pptx
Binary files differ
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: */