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

Tibor Nagy (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 10 07:23:02 UTC 2021


 sd/qa/unit/data/pptx/tdf143126.pptx      |binary
 sd/qa/unit/export-tests-ooxml1.cxx       |   16 ++++++++++++++++
 sd/source/filter/eppt/pptx-epptooxml.cxx |   29 +++++++++++++++++++++++++++--
 3 files changed, 43 insertions(+), 2 deletions(-)

New commits:
commit 9cda220e98acda221b204b49d5d91ce4375cb2a7
Author:     Tibor Nagy <nagy.tibor2 at nisz.hu>
AuthorDate: Thu Jul 8 16:12:05 2021 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Tue Aug 10 09:22:23 2021 +0200

    tdf#143126 PPTX: slideshow setting “Start from” not exported
    
    Follow-up to commit 3d55149dcf19cffefcc19c16a3abbe8851453c5e
    (tdf#142913 PPTX: slideshow setting “Start from” not imported).
    
    Change-Id: I4124e528f8af61c3b87978c2f3d2b96d983ec056
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118648
    Tested-by: Jenkins
    Tested-by: László Németh <nemeth at numbertext.org>
    Reviewed-by: László Németh <nemeth at numbertext.org>
    (cherry picked from commit d2c2985024ee085796a21ef9c3226dde10311c80)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120238
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sd/qa/unit/data/pptx/tdf143126.pptx b/sd/qa/unit/data/pptx/tdf143126.pptx
new file mode 100644
index 000000000000..f5799b60f26b
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf143126.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx
index a450e6d890eb..8c1db529b89c 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -117,6 +117,7 @@ public:
     void testTdf140865Wordart3D();
     void testTdf124457();
     void testPlaceholderFillAndOutlineExport();
+    void testTdf143126();
 
     CPPUNIT_TEST_SUITE(SdOOXMLExportTest1);
 
@@ -176,6 +177,7 @@ public:
     CPPUNIT_TEST(testTdf140865Wordart3D);
     CPPUNIT_TEST(testTdf124457);
     CPPUNIT_TEST(testPlaceholderFillAndOutlineExport);
+    CPPUNIT_TEST(testTdf143126);
 
     CPPUNIT_TEST_SUITE_END();
 
@@ -1555,6 +1557,20 @@ void SdOOXMLExportTest1::testTdf124457()
                 "repeatCount", "indefinite");
 }
 
+void SdOOXMLExportTest1::testTdf143126()
+{
+    sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf143126.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:sldRg", "st", "2" );
+    assertXPath(pXmlDoc, "/p:presentationPr/p:showPr/p:sldRg", "end", "3" );
+}
+
 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 f30a4d040fc6..e9b219bbcd6e 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -1067,6 +1067,7 @@ void PowerPointExport::WritePresentationProps()
         Reference<beans::XPropertySet> xPresentationProps(xPresentationSupplier->getPresentation(),
                                                           uno::UNO_QUERY);
         bool bEndlessVal = xPresentationProps->getPropertyValue("IsEndless").get<bool>();
+        OUString sFirstPage = xPresentationProps->getPropertyValue("FirstPage").get<OUString>();
 
         FSHelperPtr pFS = openFragmentStreamWithSerializer(
             "ppt/presProps.xml",
@@ -1077,8 +1078,32 @@ void PowerPointExport::WritePresentationProps()
 
         pFS->startElementNS(XML_p, XML_presentationPr, PPRNMSS);
 
-        pFS->singleElementNS(XML_p, XML_showPr, XML_loop, sax_fastparser::UseIf("1", bEndlessVal),
-                             XML_showNarration, sax_fastparser::UseIf("1", bEndlessVal));
+        pFS->startElementNS(XML_p, XML_showPr, XML_loop, sax_fastparser::UseIf("1", bEndlessVal),
+                            XML_showNarration, "1");
+
+        Reference<drawing::XDrawPagesSupplier> xDPS(mXModel, uno::UNO_QUERY_THROW);
+        Reference<drawing::XDrawPages> xDrawPages(xDPS->getDrawPages(), uno::UNO_SET_THROW);
+        if (!sFirstPage.isEmpty())
+        {
+            sal_Int32 nStartSlide = 1;
+            sal_Int32 nEndSlide = xDrawPages->getCount();
+            for (sal_Int32 i = 0; i < nEndSlide; i++)
+            {
+                Reference<drawing::XDrawPage> xDrawPage;
+                xDrawPages->getByIndex(i) >>= xDrawPage;
+                Reference<container::XNamed> xNamed(xDrawPage, uno::UNO_QUERY_THROW);
+                if (xNamed->getName() == sFirstPage)
+                {
+                    nStartSlide = i + 1;
+                    break;
+                }
+            }
+
+            pFS->singleElementNS(XML_p, XML_sldRg, XML_st, OUString::number(nStartSlide), XML_end,
+                                 OUString::number(nEndSlide));
+        }
+
+        pFS->endElementNS(XML_p, XML_showPr);
 
         pFS->endElementNS(XML_p, XML_presentationPr);
     }


More information about the Libreoffice-commits mailing list