summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSarper Akdemir <sarper.akdemir@collabora.com>2021-06-09 08:24:12 +0300
committerSarper Akdemir <sarper.akdemir@collabora.com>2021-06-10 18:27:54 +0300
commit2b1c644e8e4013d6c1160d71c7b64a7cf3905a63 (patch)
treef039c80411e3592d3dcf25c7a2f891d544c5b49d
parenttdf#59323: pptx export: add support for slide footers (diff)
downloadcore-private/quwex/tdf59323.tar.gz
core-private/quwex/tdf59323.zip
tdf#59323: pptx export: slide footers roundtrip unit test private/quwex/tdf59323
Roundtrip test that checks the slide footers, and their placeholder indexes. Change-Id: I9c4b819092ac6699617d71538c35b066d6e6f974
-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..f057dd8e7e05 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(xPropSet->getPropertyValue("IsFooterVisible") == true);
+ CPPUNIT_ASSERT(xPropSet->getPropertyValue("IsDateTimeVisible") == true);
+ CPPUNIT_ASSERT(xPropSet->getPropertyValue("IsPageNumberVisible") == true);
+ }
+
+ // Test placeholder indexes
+ xmlDocUniquePtr pXmlDocMaster = parseExport(tempFile, "ppt/slideMasters/slideMaster1.xml");
+ assertXPath(pXmlDocMaster, "//p:ph [@type='dt']", "idx", "2");
+ assertXPath(pXmlDocMaster, "//p:ph [@type='ftr']", "idx", "3");
+ assertXPath(pXmlDocMaster, "//p:ph [@type='sldNum']", "idx", "4");
+
+ xmlDocUniquePtr pXmlDocSlide1 = parseExport(tempFile, "ppt/slides/slide1.xml");
+ assertXPath(pXmlDocSlide1, "//p:ph [@type='dt']", "idx", "2");
+ assertXPath(pXmlDocSlide1, "//p:ph [@type='ftr']", "idx", "3");
+ assertXPath(pXmlDocSlide1, "//p:ph [@type='sldNum']", "idx", "4");
+
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest2);
CPPUNIT_PLUGIN_IMPLEMENT();