sd/qa/unit/export-tests-ooxml1.cxx       |   14 ++++++++++++++
 sd/source/filter/eppt/pptx-epptooxml.cxx |   10 +++++++++-
 2 files changed, 23 insertions(+), 1 deletion(-)

New commits:
commit b1865ecd67a4ea791ac24e3234d4ad3d2be9d1e3
Author:     Tibor Nagy <[email protected]>
AuthorDate: Mon Jan 3 17:18:57 2022 +0100
Commit:     László Németh <[email protected]>
CommitDate: Mon Jan 31 17:06:40 2022 +0100

    tdf#130165 PPTX export: fix master objects visible property
    
    Follow-up to commit 4574a1ea408c2ac30042dca32d02207ec7add4da
    "tdf#146223 PPTX import: fix master objects visible property".
    
    Change-Id: I34e6132837d6c84974f8446978c59226a9a7d2d7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127908
    Tested-by: Jenkins
    Tested-by: László Németh <[email protected]>
    Reviewed-by: László Németh <[email protected]>

diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index 7631b3113bbd..76e54f62ea1b 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -48,6 +48,7 @@ using namespace css;
 class SdOOXMLExportTest1 : public SdModelTestBaseXML
 {
 public:
+    void testTdf130165();
     void testTdf124781();
     void testTdf144914();
     void testTdf124232();
@@ -115,6 +116,7 @@ public:
 
     CPPUNIT_TEST_SUITE(SdOOXMLExportTest1);
 
+    CPPUNIT_TEST(testTdf130165);
     CPPUNIT_TEST(testTdf124781);
     CPPUNIT_TEST(testTdf144914);
     CPPUNIT_TEST(testTdf124232);
@@ -209,6 +211,18 @@ void checkFontAttributes( const SdrTextObj* pObj, 
ItemValue nVal, sal_uInt32 nId
 
 }
 
+void SdOOXMLExportTest1::testTdf130165()
+{
+    sd::DrawDocShellRef xDocShRef
+        = 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf146223.pptx"), 
PPTX);
+    utl::TempFile tempFile;
+    xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+    xDocShRef->DoClose();
+
+    xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/slides/slide1.xml");
+    assertXPath(pXmlDoc, "/p:sld", "showMasterSp", "0");
+}
+
 void SdOOXMLExportTest1::testTdf124781()
 {
     sd::DrawDocShellRef xDocShRef
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx 
b/sd/source/filter/eppt/pptx-epptooxml.cxx
index b728278c843f..f6e78d357ead 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -1361,6 +1361,7 @@ void PowerPointExport::ImplWriteSlide(sal_uInt32 
nPageNum, sal_uInt32 nMasterNum
     mpSlidesFSArray[ nPageNum ] = pFS;
 
     const char* pShow = nullptr;
+    const char* pShowMasterShape = nullptr;
 
     if (ImplGetPropertyValue(mXPagePropSet, "Visible"))
     {
@@ -1369,7 +1370,14 @@ void PowerPointExport::ImplWriteSlide(sal_uInt32 
nPageNum, sal_uInt32 nMasterNum
             pShow = "0";
     }
 
-    pFS->startElementNS(XML_p, XML_sld, PNMSS, XML_show, pShow);
+    if (ImplGetPropertyValue(mXPagePropSet, "IsBackgroundObjectsVisible"))
+    {
+        bool bShowMasterShape(false);
+        if ((mAny >>= bShowMasterShape) && !bShowMasterShape)
+            pShowMasterShape = "0";
+    }
+
+    pFS->startElementNS(XML_p, XML_sld, PNMSS, XML_show, pShow, 
XML_showMasterSp, pShowMasterShape);
 
     pFS->startElementNS(XML_p, XML_cSld);
 

Reply via email to