diff options
author | Tibor Nagy <nagy.tibor2@nisz.hu> | 2021-06-01 20:09:07 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2021-06-08 16:37:40 +0200 |
commit | 312334f8488a668e9b5302959b60292ce151e4fc (patch) | |
tree | af759cd962e511fc4665ee88d3cd3d363631300c /sd/source | |
parent | 92d731d256d8a030ee1a150b04f0a7597171fb52 (diff) |
tdf#47365 PPTX export: support loop attribute
Follow-up to commit ad2809b4b6dc4837b0c1cadd89a14a234d995fb2
"tdf#47365: import support for PPTX presentation's loop attribute".
Change-Id: I7f75acc2bbd6301384883691d5ef4069b1757a05
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116560
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/filter/eppt/epptooxml.hxx | 2 | ||||
-rw-r--r-- | sd/source/filter/eppt/pptx-epptooxml.cxx | 32 |
2 files changed, 34 insertions, 0 deletions
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); |