summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorTibor Nagy <nagy.tibor2@nisz.hu>2021-07-27 16:17:37 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2021-08-12 19:29:46 +0200
commit6d0ef663227cde189b307036be7d3dfc6ca6ce4c (patch)
tree227d52a8d3ae213d6e397ee571456a00db552bca /sd
parent53902e2ecf8ab1bb3f1cfa203de105d6d956e7ef (diff)
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@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit 569cb54f1d82e993dcf1fd11d92d4cbd4f224a2d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120364 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/tdf143129.pptxbin0 -> 31053 bytes
-rw-r--r--sd/qa/unit/export-tests-ooxml1.cxx15
-rw-r--r--sd/source/filter/eppt/pptx-epptooxml.cxx22
3 files changed, 37 insertions, 0 deletions
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
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf143129.pptx
Binary files 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);