summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorSarper Akdemir <sarper.akdemir@collabora.com>2021-06-09 08:24:12 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-06-23 11:51:30 +0200
commitf34cf6a2e67e75f83498b3a1890668784416bde2 (patch)
tree8dc171f2524b5b0f7678ba6e4fd1b19c440857f3 /sd
parent3dab66894615fde0891027a04788238d679b13f5 (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> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117631 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sd')
-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 c4a4bfd28b2b..ec756b19d7bb 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -211,6 +211,7 @@ public:
void testTdf96061_textHighlight();
void testTextColumns_tdf140852();
void testTextColumns_3columns();
+ void testTdf59323_slideFooters();
CPPUNIT_TEST_SUITE(SdOOXMLExportTest2);
@@ -336,6 +337,7 @@ public:
CPPUNIT_TEST(testTdf96061_textHighlight);
CPPUNIT_TEST(testTextColumns_tdf140852);
CPPUNIT_TEST(testTextColumns_3columns);
+ CPPUNIT_TEST(testTdf59323_slideFooters);
CPPUNIT_TEST_SUITE_END();
@@ -3245,6 +3247,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();