summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/export-tests-ooxml1.cxx16
-rw-r--r--sd/source/filter/eppt/epptooxml.hxx2
-rw-r--r--sd/source/filter/eppt/pptx-epptooxml.cxx32
3 files changed, 50 insertions, 0 deletions
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx
index d5c2d8d41a31..a450e6d890eb 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -61,6 +61,7 @@ using namespace css;
class SdOOXMLExportTest1 : public SdModelTestBaseXML
{
public:
+ void testTdf47365();
void testTdf125071();
void testTdf54037();
void testFdo90607();
@@ -119,6 +120,7 @@ public:
CPPUNIT_TEST_SUITE(SdOOXMLExportTest1);
+ CPPUNIT_TEST(testTdf47365);
CPPUNIT_TEST(testTdf125071);
CPPUNIT_TEST(testTdf54037);
CPPUNIT_TEST(testFdo90607);
@@ -204,6 +206,20 @@ void checkFontAttributes( const SdrTextObj* pObj, ItemValue nVal, sal_uInt32 nId
}
+void SdOOXMLExportTest1::testTdf47365()
+{
+ sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/loopNoPause.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", "loop", "1");
+
+ assertXPath(pXmlDoc, "/p:presentationPr/p:showPr", "showNarration", "1");
+}
+
void SdOOXMLExportTest1::testTdf125071()
{
sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf125071.pptx"), PPTX);
diff --git a/sd/source/filter/eppt/epptooxml.hxx b/sd/source/filter/eppt/epptooxml.hxx
index 43beea7ca032..93029f073487 100644
--- a/sd/source/filter/eppt/epptooxml.hxx
+++ b/sd/source/filter/eppt/epptooxml.hxx
@@ -151,6 +151,8 @@ private:
void WriteAuthors();
+ void WritePresentationProps();
+
/// If this is PPTM, output the VBA stream.
void WriteVBA();
};
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index a1a6dd6cad5d..6a8502361061 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -50,6 +50,7 @@
#include <com/sun/star/presentation/XCustomPresentationSupplier.hpp>
#include <com/sun/star/container/XIndexContainer.hpp>
#include <com/sun/star/container/XNamed.hpp>
+#include <com/sun/star/presentation/XPresentationSupplier.hpp>
#include <oox/export/utils.hxx>
@@ -71,6 +72,10 @@
FSNS(XML_xmlns, XML_p15), OUStringToOString(this->getNamespaceURL(OOX_NS(p15)), RTL_TEXTENCODING_UTF8).getStr(), \
FSNS(XML_xmlns, XML_mc), OUStringToOString(this->getNamespaceURL(OOX_NS(mce)), RTL_TEXTENCODING_UTF8).getStr()
+// presentationPr namespace
+#define PPRNMSS FSNS(XML_xmlns, XML_a), OUStringToOString(this->getNamespaceURL(OOX_NS(dml)), RTL_TEXTENCODING_UTF8).getStr(), \
+ FSNS(XML_xmlns, XML_r), OUStringToOString(this->getNamespaceURL(OOX_NS(officeRel)), RTL_TEXTENCODING_UTF8).getStr(), \
+ FSNS(XML_xmlns, XML_p), OUStringToOString(this->getNamespaceURL(OOX_NS(ppt)), RTL_TEXTENCODING_UTF8).getStr()
using namespace ::com::sun::star;
using namespace ::com::sun::star::animations;
@@ -441,6 +446,8 @@ bool PowerPointExport::exportDocument()
WriteCustomSlideShow();
+ WritePresentationProps();
+
WriteAuthors();
WriteVBA();
@@ -1052,6 +1059,31 @@ sal_Int32 PowerPointExport::GetAuthorIdAndLastIndex(const OUString& sAuthor, sal
return maAuthors[ sAuthor ].nId;
}
+void PowerPointExport::WritePresentationProps()
+{
+ Reference<XPresentationSupplier> xPresentationSupplier(mXModel, uno::UNO_QUERY);
+ if (xPresentationSupplier.is())
+ {
+ Reference<beans::XPropertySet> xPresentationProps(xPresentationSupplier->getPresentation(),
+ uno::UNO_QUERY);
+ bool bEndlessVal = xPresentationProps->getPropertyValue("IsEndless").get<bool>();
+
+ FSHelperPtr pFS = openFragmentStreamWithSerializer(
+ "ppt/presProps.xml",
+ "application/vnd.openxmlformats-officedocument.presentationml.presProps+xml");
+
+ addRelation(mPresentationFS->getOutputStream(),
+ oox::getRelationship(Relationship::PRESPROPS), u"presProps.xml");
+
+ 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->endElementNS(XML_p, XML_presentationPr);
+ }
+}
+
bool PowerPointExport::WriteComments(sal_uInt32 nPageNum)
{
Reference< XAnnotationAccess > xAnnotationAccess(mXDrawPage, uno::UNO_QUERY);