[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sd/qa sd/source

Tibor Nagy (via logerrit) logerrit at kemper.freedesktop.org
Thu Aug 12 17:30:24 UTC 2021


 sd/qa/unit/data/pptx/tdf143129.pptx      |binary
 sd/qa/unit/export-tests-ooxml1.cxx       |   15 +++++++++++++++
 sd/source/filter/eppt/pptx-epptooxml.cxx |   22 ++++++++++++++++++++++
 3 files changed, 37 insertions(+)

New commits:
commit 6d0ef663227cde189b307036be7d3dfc6ca6ce4c
Author:     Tibor Nagy <nagy.tibor2 at nisz.hu>
AuthorDate: Tue Jul 27 16:17:37 2021 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Thu Aug 12 19:29:46 2021 +0200

    tdf#143129 PPTX: custom slide show use as default is not exported.
    
    Follow-up to commit 11ef976624dce8a8e50a1eb20e9c586519fd7ec8
    "tdf#142590 PPTX import: fix custom slide show use as default"
    
    Change-Id: Ie8a53a79bd531cfe2c3b3559b70d28770ca8b960
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119564
    Tested-by: László Németh <nemeth at numbertext.org>
    Reviewed-by: László Németh <nemeth at numbertext.org>
    (cherry picked from commit 569cb54f1d82e993dcf1fd11d92d4cbd4f224a2d)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120364
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sd/qa/unit/data/pptx/tdf143129.pptx b/sd/qa/unit/data/pptx/tdf143129.pptx
new file mode 100644
index 000000000000..77377c212be8
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf143129.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx
index 8c1db529b89c..34d9c9865b70 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -118,6 +118,7 @@ public:
     void testTdf124457();
     void testPlaceholderFillAndOutlineExport();
     void testTdf143126();
+    void testTdf143129();
 
     CPPUNIT_TEST_SUITE(SdOOXMLExportTest1);
 
@@ -178,6 +179,7 @@ public:
     CPPUNIT_TEST(testTdf124457);
     CPPUNIT_TEST(testPlaceholderFillAndOutlineExport);
     CPPUNIT_TEST(testTdf143126);
+    CPPUNIT_TEST(testTdf143129);
 
     CPPUNIT_TEST_SUITE_END();
 
@@ -1571,6 +1573,19 @@ void SdOOXMLExportTest1::testTdf143126()
     assertXPath(pXmlDoc, "/p:presentationPr/p:showPr/p:sldRg", "end", "3" );
 }
 
+void SdOOXMLExportTest1::testTdf143129()
+{
+    sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf143129.pptx"), PPTX);
+    utl::TempFile tempFile;
+    xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+    xDocShRef->DoClose();
+
+    xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/presProps.xml");
+
+    assertXPath(pXmlDoc, "/p:presentationPr/p:showPr", "showNarration", "1");
+    assertXPath(pXmlDoc, "/p:presentationPr/p:showPr/p:custShow", "id", "0" );
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest1);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index e9b219bbcd6e..0cf86db84340 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -1068,6 +1068,7 @@ void PowerPointExport::WritePresentationProps()
                                                           uno::UNO_QUERY);
         bool bEndlessVal = xPresentationProps->getPropertyValue("IsEndless").get<bool>();
         OUString sFirstPage = xPresentationProps->getPropertyValue("FirstPage").get<OUString>();
+        OUString sCustomShow = xPresentationProps->getPropertyValue("CustomShow").get<OUString>();
 
         FSHelperPtr pFS = openFragmentStreamWithSerializer(
             "ppt/presProps.xml",
@@ -1103,6 +1104,27 @@ void PowerPointExport::WritePresentationProps()
                                  OUString::number(nEndSlide));
         }
 
+        if (!sCustomShow.isEmpty())
+        {
+            css::uno::Reference<css::presentation::XCustomPresentationSupplier>
+                XCustPresentationSupplier(mXModel, css::uno::UNO_QUERY_THROW);
+            css::uno::Reference<css::container::XNameContainer> mxCustShows;
+            mxCustShows = XCustPresentationSupplier->getCustomPresentations();
+            const css::uno::Sequence<OUString> aNameSeq(mxCustShows->getElementNames());
+
+            sal_Int32 nCustShowIndex = 0;
+            for (sal_Int32 i = 0; i < aNameSeq.getLength(); i++)
+            {
+                if (aNameSeq[i] == sCustomShow)
+                {
+                    nCustShowIndex = i;
+                    break;
+                }
+            }
+
+            pFS->singleElementNS(XML_p, XML_custShow, XML_id, OUString::number(nCustShowIndex));
+        }
+
         pFS->endElementNS(XML_p, XML_showPr);
 
         pFS->endElementNS(XML_p, XML_presentationPr);


More information about the Libreoffice-commits mailing list