sd/qa/unit/data/odp/tdf170102_layout_type.odp |binary
 sd/qa/unit/export-tests-ooxml4.cxx            |   34 ++++++++++++++++++++++++++
 2 files changed, 34 insertions(+)

New commits:
commit 1536309c676faed2fa98c7a80207be39a9216600
Author:     Aron Budea <[email protected]>
AuthorDate: Thu Dec 25 22:17:53 2025 +1100
Commit:     Mike Kaganski <[email protected]>
CommitDate: Sun Dec 28 09:34:41 2025 +0100

    tdf#170102 add unit test
    
    Change-Id: Ife6ef29174973202cef9307569f6c2259dc86c70
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196211
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <[email protected]>
    (cherry picked from commit e54b0825f75bcb57b1f8b4c9ac0d85bccc688532)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196259
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/sd/qa/unit/data/odp/tdf170102_layout_type.odp 
b/sd/qa/unit/data/odp/tdf170102_layout_type.odp
new file mode 100644
index 000000000000..ed0615213b72
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf170102_layout_type.odp 
differ
diff --git a/sd/qa/unit/export-tests-ooxml4.cxx 
b/sd/qa/unit/export-tests-ooxml4.cxx
index 0895ee2630bc..2895e16a2d02 100644
--- a/sd/qa/unit/export-tests-ooxml4.cxx
+++ b/sd/qa/unit/export-tests-ooxml4.cxx
@@ -1736,6 +1736,40 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, 
testtdf169825_layout_type)
     assertXPath(pXmlDocLayout, "/p:sldLayout", "type", u"blank");
 }
 
+CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testtdf170102_layout_type)
+{
+    createSdImpressDoc("odp/tdf170102_layout_type.odp");
+    saveAndReload(u"Impress Office Open XML"_ustr);
+
+    uno::Reference<drawing::XMasterPagesSupplier> xDoc(mxComponent, 
uno::UNO_QUERY);
+    CPPUNIT_ASSERT(xDoc.is());
+    sal_Int32 nMPCount = xDoc->getMasterPages()->getCount();
+    // test roughly the same thing in document and in XML: no drawing object 
in master page/layout
+    for (sal_Int32 i = 0; i < nMPCount; i++)
+    {
+        uno::Reference<drawing::XDrawPage> 
xPage(xDoc->getMasterPages()->getByIndex(i),
+                                                 uno::UNO_QUERY_THROW);
+        sal_Int32 nObjCount = xPage->getCount();
+        for (sal_Int32 j = 0; j < nObjCount; j++)
+        {
+            uno::Reference<lang::XServiceInfo> xShapeInfo(xPage->getByIndex(j),
+                                                          
uno::UNO_QUERY_THROW);
+            // without the fix in place there would be a graphic shape 
placeholder
+            CPPUNIT_ASSERT_MESSAGE(
+                "Unexpected graphic object shape in exported master page",
+                
!xShapeInfo->supportsService(u"com.sun.star.drawing.GraphicObjectShape"_ustr));
+        }
+
+        xmlDocUniquePtr pXmlDocLayout = 
parseExport(u"ppt/slideLayouts/slideLayout"_ustr
+                                                    + OUString::number(i + 1) 
+ u".xml"_ustr);
+        CPPUNIT_ASSERT(pXmlDocLayout);
+        // without the fix in place there would be a pic layout element for 
the placeholder
+        CPPUNIT_ASSERT_EQUAL_MESSAGE(
+            "Unexpected \"pic\" element in exported PPTX slide layout", 0,
+            countXPathNodes(pXmlDocLayout, 
"/p:sldLayout/p:cSld/p:spTree/p:pic"));
+    }
+}
+
 CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest4, testFooterIdxConsistency)
 {
     createSdImpressDoc("pptx/multiplelayoutfooter.pptx");

Reply via email to