summaryrefslogtreecommitdiff
path: root/sd/source/filter/eppt/pptx-epptooxml.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source/filter/eppt/pptx-epptooxml.cxx')
-rw-r--r--sd/source/filter/eppt/pptx-epptooxml.cxx67
1 files changed, 20 insertions, 47 deletions
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 03ddcd056e3f..2319b431ee8a 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -26,6 +26,7 @@
#include <epptdef.hxx>
#include <oox/export/shapes.hxx>
+#include <comphelper/sequenceashashmap.hxx>
#include <cppuhelper/implementationentry.hxx>
#include <cppuhelper/factory.hxx>
#include <sax/fshelper.hxx>
@@ -91,7 +92,9 @@ using ::com::sun::star::beans::XPropertySet;
using ::com::sun::star::beans::XPropertySetInfo;
using ::com::sun::star::container::XIndexAccess;
using ::sax_fastparser::FSHelperPtr;
-
+using namespace oox;
+using namespace oox::drawingml;
+using namespace oox::core;
#if OSL_DEBUG_LEVEL > 1
void dump_pset(Reference< XPropertySet > const & rXPropSet);
@@ -99,10 +102,6 @@ void dump_pset(Reference< XPropertySet > const & rXPropSet);
#define IDS(x) OString(OStringLiteral(#x " ") + OString::number( mnShapeIdMax++ )).getStr()
-namespace oox {
- using namespace drawingml;
- namespace core {
-
class PowerPointShapeExport : public ShapeExport
{
PowerPointExport& mrExport;
@@ -313,8 +312,8 @@ ShapeExport& PowerPointShapeExport::WriteUnknownShape( const Reference< XShape >
return *this;
}
-PowerPointExport::PowerPointExport( const Reference< XComponentContext > & rxCtxt )
- : XmlFilterBase(rxCtxt)
+PowerPointExport::PowerPointExport(const Reference< XComponentContext > & rContext, const uno::Sequence<uno::Any>& rArguments)
+ : XmlFilterBase(rContext)
, PPTWriterBase()
, mnLayoutFileIdMax(1)
, mnSlideIdMax(1 << 8)
@@ -323,6 +322,9 @@ PowerPointExport::PowerPointExport( const Reference< XComponentContext > & rxCtx
, mbCreateNotes(false)
{
memset( mLayoutInfo, 0, sizeof(mLayoutInfo) );
+
+ comphelper::SequenceAsHashMap aArgumentsMap(rArguments);
+ mbPptm = aArgumentsMap.getUnpackedValueOrDefault("IsPPTM", false);
}
PowerPointExport::~PowerPointExport()
@@ -357,8 +359,12 @@ bool PowerPointExport::exportDocument() throw (css::uno::RuntimeException, std::
addRelation( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", "ppt/presentation.xml" );
- mPresentationFS = openFragmentStreamWithSerializer( "ppt/presentation.xml",
- "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml" );
+ // PPTM needs a different media type for the presentation.xml stream.
+ OUString aMediaType("application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml");
+ if (mbPptm)
+ aMediaType = "application/vnd.ms-powerpoint.presentation.macroEnabled.main+xml";
+
+ mPresentationFS = openFragmentStreamWithSerializer("ppt/presentation.xml", aMediaType);
addRelation( mPresentationFS->getOutputStream(),
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",
@@ -2288,50 +2294,17 @@ bool PowerPointExport::ImplCreateMainNotes()
return true;
}
-OUString SAL_CALL PowerPointExport_getImplementationName() throw()
-{
- return OUString( "com.sun.star.comp.Impress.oox.PowerPointExport" );
-}
-
-uno::Sequence< OUString > SAL_CALL PowerPointExport_getSupportedServiceNames() throw()
-{
- return Sequence< OUString >();
-}
-
-uno::Reference< uno::XInterface > SAL_CALL PowerPointExport_createInstance(const uno::Reference< XComponentContext > & rxCtxt ) throw( uno::Exception )
-{
- return static_cast<cppu::OWeakObject*>(new PowerPointExport( rxCtxt ));
-}
-
OUString PowerPointExport::getImplementationName() throw (css::uno::RuntimeException, std::exception)
{
- return PowerPointExport_getImplementationName();
-}
-}
+ return OUString("com.sun.star.comp.Impress.oox.PowerPointExport");
}
// UNO component
-
-static const struct cppu::ImplementationEntry g_entries[] =
-{
- {
- oox::core::PowerPointExport_createInstance,
- oox::core::PowerPointExport_getImplementationName,
- oox::core::PowerPointExport_getSupportedServiceNames,
- cppu::createSingleComponentFactory,
- nullptr , 0
- },
- { nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
-};
-
-extern "C"
-{
-
-SAL_DLLPUBLIC_EXPORT void* SAL_CALL sdfilt_component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* pRegistryKey )
+extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface* SAL_CALL
+css_comp_Impress_oox_PowerPointExport(uno::XComponentContext* rxCtxt,
+ uno::Sequence<css::uno::Any> const& rArguments)
{
- return cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey , g_entries );
-}
-
+ return cppu::acquire(new PowerPointExport(rxCtxt, rArguments));
}
#if OSL_DEBUG_LEVEL > 1