Kaydet (Commit) e8bdd388 authored tarafından Heena Gupta's avatar Heena Gupta Kaydeden (comit) Michael Stahl

fdo#83751-FILESAVE:Custom Properties dropped while exporting to .pptx

Change-Id: Ic4b8acfc3cbd8c86b765a950d61742c229f3fb6d
Reviewed-on: https://gerrit.libreoffice.org/11390Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
Tested-by: 's avatarMichael Stahl <mstahl@redhat.com>
üst a9246068
......@@ -128,6 +128,9 @@ protected:
sal_Int32 GetAuthorIdAndLastIndex( const OUString& sAuthor, sal_Int32& nLastIndex );
private:
// Write docProps/core.xml and docprops/custom.xml and docprops/app.xml
void writeDocumentProperties();
void AddLayoutIdAndRelation( ::sax_fastparser::FSHelperPtr pFS, sal_Int32 nLayoutFileId );
virtual OUString implGetImplementationName() const SAL_OVERRIDE;
......
......@@ -64,6 +64,9 @@
#include "pptexanimations.hxx"
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
// presentation namespaces
#define PNMSS FSNS( XML_xmlns, XML_a ), "http://schemas.openxmlformats.org/drawingml/2006/main", \
FSNS( XML_xmlns, XML_p ), "http://schemas.openxmlformats.org/presentationml/2006/main", \
......@@ -318,6 +321,18 @@ PowerPointExport::~PowerPointExport()
{
}
void PowerPointExport::writeDocumentProperties()
{
uno::Reference<document::XDocumentPropertiesSupplier> xDPS( mXModel, uno::UNO_QUERY );
uno::Reference<document::XDocumentProperties> xDocProps = xDPS->getDocumentProperties();
if (xDocProps.is())
{
PowerPointExport& mrExport(*this);
mrExport.exportDocumentProperties( xDocProps );
}
}
bool PowerPointExport::importDocument() throw()
{
return false;
......@@ -328,6 +343,11 @@ bool PowerPointExport::exportDocument() throw (css::uno::RuntimeException, std::
DrawingML::ResetCounters();
maShapeMap.clear ();
mXModel.set( getModel(), UNO_QUERY );
//write document properties
writeDocumentProperties();
addRelation( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", "ppt/presentation.xml" );
mPresentationFS = openFragmentStreamWithSerializer( "ppt/presentation.xml",
......@@ -339,7 +359,6 @@ bool PowerPointExport::exportDocument() throw (css::uno::RuntimeException, std::
mPresentationFS->startElementNS( XML_p, XML_presentation, PNMSS, FSEND );
mXModel.set( getModel(), UNO_QUERY );
mXStatusIndicator.set( getStatusIndicator(), UNO_QUERY );
OUString sBaseURI( "BaseURI");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment