sd/qa/unit/data/odp/canvas-slide.odp |binary sd/qa/unit/export-tests-ooxml4.cxx | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+)
New commits: commit 26398b69f039b91b1c55b17116ba1fe2f9f9c0a4 Author: Mohit Marathe <[email protected]> AuthorDate: Mon Dec 15 16:58:22 2025 +0530 Commit: Mohit Marathe <[email protected]> CommitDate: Wed Dec 17 13:14:19 2025 +0100 sd: add testOmitCanvasSlideExport This unit test verifies if canvas page is omitted while exporting to pptx Signed-off-by: Mohit Marathe <[email protected]> Change-Id: I3a269499772306c33998b33524376aa329c15273 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195658 Reviewed-by: Michael Stahl <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/sd/qa/unit/data/odp/canvas-slide.odp b/sd/qa/unit/data/odp/canvas-slide.odp new file mode 100644 index 000000000000..f73114937e6f Binary files /dev/null and b/sd/qa/unit/data/odp/canvas-slide.odp differ diff --git a/sd/qa/unit/export-tests-ooxml4.cxx b/sd/qa/unit/export-tests-ooxml4.cxx index fd0eef3fac23..0895ee2630bc 100644 --- a/sd/qa/unit/export-tests-ooxml4.cxx +++ b/sd/qa/unit/export-tests-ooxml4.cxx @@ -1772,6 +1772,28 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testTdf169559) "val", u"1701"); } +CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testOmitCanvasSlideExport) +{ + createSdImpressDoc("odp/canvas-slide.odp"); + + SdXImpressDocument* pXImpressDocument = dynamic_cast<SdXImpressDocument*>(mxComponent.get()); + CPPUNIT_ASSERT(pXImpressDocument); + SdDrawDocument* pDoc = pXImpressDocument->GetDoc(); + CPPUNIT_ASSERT_MESSAGE("no document", pDoc != nullptr); + + // the document has 2 pages - one canvas page, and one normal page + CPPUNIT_ASSERT_EQUAL(sal_uInt16(2), pDoc->GetSdPageCount(PageKind::Standard)); + CPPUNIT_ASSERT(pDoc->HasCanvasPage()); + + save(u"Impress Office Open XML"_ustr); + + // Verify that the canvas slide was omitted from the export + // It should have one master slide, and one slide + xmlDocUniquePtr pXmlDocContent = parseExport(u"ppt/presentation.xml"_ustr); + assertXPath(pXmlDocContent, "/p:presentation/p:sldMasterIdLst/p:sldMasterId", 1); + assertXPath(pXmlDocContent, "/p:presentation/p:sldIdLst/p:sldId", 1); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
