diff --git a/sd/qa/unit/data/pptx/tdf146731.pptx b/sd/qa/unit/data/pptx/tdf146731.pptx new file mode 100644 index 000000000000..3862e45461a3 Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf146731.pptx differ diff --git a/sd/qa/unit/layout-tests.cxx b/sd/qa/unit/layout-tests.cxx index 102c6a8153b0..4ea92807c49a 100644 --- a/sd/qa/unit/layout-tests.cxx +++ b/sd/qa/unit/layout-tests.cxx @@ -17,6 +17,7 @@ public: void testTdf128212(); void testColumnsLayout(); void tdf143258_testTbRlLayout(); + void testTdf146731(); CPPUNIT_TEST_SUITE(SdLayoutTest); @@ -26,6 +27,7 @@ public: CPPUNIT_TEST(testTdf128212); CPPUNIT_TEST(testColumnsLayout); CPPUNIT_TEST(tdf143258_testTbRlLayout); + CPPUNIT_TEST(testTdf146731); CPPUNIT_TEST_SUITE_END(); }; @@ -276,6 +278,30 @@ void SdLayoutTest::tdf143258_testTbRlLayout() xDocShRef->DoClose(); } +void SdLayoutTest::testTdf146731() +{ + sd::DrawDocShellRef xDocShRef + = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf146731.pptx"), PPTX); + + std::shared_ptr xMetaFile = xDocShRef->GetPreviewMetaFile(); + MetafileXmlDump dumper; + + xmlDocUniquePtr pXmlDoc = XmlTestTools::dumpAndParse(dumper, *xMetaFile); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[3]/polyline[1]", "width", "187"); + assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[4]/polyline[1]", "width", "187"); + assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[5]/polyline[1]", "width", "187"); + + // Without the fix in place, this test would have failed with + // - Expected: 30 + // - Actual : 187 + assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[6]/polyline[1]", "width", "30"); + assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[7]/polyline[1]", "width", "187"); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdLayoutTest); CPPUNIT_PLUGIN_IMPLEMENT();