summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSarper Akdemir <sarper.akdemir@collabora.com>2021-06-09 08:24:12 +0300
committerMiklos Vajna <vmiklos@collabora.com>2021-06-16 15:06:12 +0200
commitf283ec0bf68734558e903339f2f0d86633cc9a62 (patch)
tree66920d35a6c90c2cbc67cf8f007f328226535fa9
parent25ae0de974befb9c279936046056a850d77e0dca (diff)
tdf#59323: pptx export: slide footers roundtrip unit test
Roundtrip test that checks the slide footers, and their placeholder indexes. Change-Id: I9c4b819092ac6699617d71538c35b066d6e6f974 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117013 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rwxr-xr-xsd/qa/unit/data/pptx/tdf59323.pptxbin0 -> 39322 bytes
-rw-r--r--sd/qa/unit/export-tests-ooxml2.cxx37
2 files changed, 37 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf59323.pptx b/sd/qa/unit/data/pptx/tdf59323.pptx
new file mode 100755
index 000000000000..0660c0af4f23
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf59323.pptx
Binary files differ
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx
index b2d30225af44..e2cdef3d76f6 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -149,6 +149,7 @@ public:
void testTdf118825();
void testTextColumns_tdf140852();
void testTextColumns_3columns();
+ void testTdf59323_slideFooters();
CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
@@ -213,6 +214,7 @@ public:
CPPUNIT_TEST(testTdf118825);
CPPUNIT_TEST(testTextColumns_tdf140852);
CPPUNIT_TEST(testTextColumns_3columns);
+ CPPUNIT_TEST(testTdf59323_slideFooters);
CPPUNIT_TEST_SUITE_END();
@@ -1742,6 +1744,41 @@ void SdOOXMLExportTest2::testTextColumns_3columns()
tempFile.EnableKillingFile();
}
+void SdOOXMLExportTest2::testTdf59323_slideFooters()
+{
+ ::sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf59323.pptx"), PPTX);
+
+ utl::TempFile tempFile;
+ xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+
+ uno::Reference<drawing::XDrawPagesSupplier> xDoc(xDocShRef->GetDoc()->getUnoModel(),
+ uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xDoc->getDrawPages()->getCount());
+
+ for (int nPageIndex = 0; nPageIndex < 3; nPageIndex++)
+ {
+ uno::Reference<drawing::XDrawPage> xPage(getPage(0, xDocShRef));
+ uno::Reference<beans::XPropertySet> xPropSet(xPage, uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(true, xPropSet->getPropertyValue("IsFooterVisible").get<bool>());
+ CPPUNIT_ASSERT_EQUAL(true, xPropSet->getPropertyValue("IsDateTimeVisible").get<bool>());
+ CPPUNIT_ASSERT_EQUAL(true, xPropSet->getPropertyValue("IsPageNumberVisible").get<bool>());
+ }
+
+ // Test placeholder indexes
+ xmlDocUniquePtr pXmlDocMaster = parseExport(tempFile, "ppt/slideMasters/slideMaster1.xml");
+ assertXPath(pXmlDocMaster, "//p:ph [@type='dt']", "idx", "1");
+ assertXPath(pXmlDocMaster, "//p:ph [@type='ftr']", "idx", "2");
+ assertXPath(pXmlDocMaster, "//p:ph [@type='sldNum']", "idx", "3");
+
+ xmlDocUniquePtr pXmlDocSlide1 = parseExport(tempFile, "ppt/slides/slide1.xml");
+ assertXPath(pXmlDocSlide1, "//p:ph [@type='dt']", "idx", "1");
+ assertXPath(pXmlDocSlide1, "//p:ph [@type='ftr']", "idx", "2");
+ assertXPath(pXmlDocSlide1, "//p:ph [@type='sldNum']", "idx", "3");
+
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
CPPUNIT_PLUGIN_IMPLEMENT();