[Libreoffice-commits] core.git: sd/qa
Sarper Akdemir (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jun 16 13:06:49 UTC 2021
sd/qa/unit/data/pptx/tdf59323.pptx |binary
sd/qa/unit/export-tests-ooxml2.cxx | 37 +++++++++++++++++++++++++++++++++++++
2 files changed, 37 insertions(+)
New commits:
commit f283ec0bf68734558e903339f2f0d86633cc9a62
Author: Sarper Akdemir <sarper.akdemir at collabora.com>
AuthorDate: Wed Jun 9 08:24:12 2021 +0300
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Jun 16 15:06:12 2021 +0200
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 at collabora.com>
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
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf59323.pptx 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();
More information about the Libreoffice-commits
mailing list