From e36b151a5bfbd8a1e3e65e43ddbc082d5ca77a9c Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Tue, 20 Oct 2020 13:39:02 +0200 Subject: tdf#128212: sd_layout_tests: Add unittest Change-Id: I099969143a25db1a580be5057e136cf05721f270 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104560 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- sd/qa/unit/data/odp/tdf128212.pptx | Bin 0 -> 16921 bytes sd/qa/unit/layout-tests.cxx | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 sd/qa/unit/data/odp/tdf128212.pptx (limited to 'sd') diff --git a/sd/qa/unit/data/odp/tdf128212.pptx b/sd/qa/unit/data/odp/tdf128212.pptx new file mode 100644 index 000000000000..52ba8ed0d81a Binary files /dev/null and b/sd/qa/unit/data/odp/tdf128212.pptx differ diff --git a/sd/qa/unit/layout-tests.cxx b/sd/qa/unit/layout-tests.cxx index 953500dc25a2..5fe1a5a4b6de 100644 --- a/sd/qa/unit/layout-tests.cxx +++ b/sd/qa/unit/layout-tests.cxx @@ -13,11 +13,13 @@ class SdLayoutTest : public SdModelTestBaseXML public: void testTdf104722(); void testTdf136949(); + void testTdf128212(); CPPUNIT_TEST_SUITE(SdLayoutTest); CPPUNIT_TEST(testTdf104722); CPPUNIT_TEST(testTdf136949); + CPPUNIT_TEST(testTdf128212); CPPUNIT_TEST_SUITE_END(); }; @@ -63,6 +65,26 @@ void SdLayoutTest::testTdf136949() xDocShRef->DoClose(); } +void SdLayoutTest::testTdf128212() +{ + sd::DrawDocShellRef xDocShRef + = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/tdf128212.pptx"), PPTX); + + std::shared_ptr xMetaFile = xDocShRef->GetPreviewMetaFile(); + MetafileXmlDump dumper; + + xmlDocUniquePtr pXmlDoc = XmlTestTools::dumpAndParse(dumper, *xMetaFile); + CPPUNIT_ASSERT(pXmlDoc); + + // Without the fix in place, this test would have failed with + // - Expected: 7797 + // - Actual : 12068 + assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/textarray", "x", "4525"); + assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/textarray", "y", "7797"); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdLayoutTest); CPPUNIT_PLUGIN_IMPLEMENT(); -- cgit