diff options
author | Jan Holesovsky <kendy@collabora.com> | 2017-07-19 08:42:36 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-07-20 09:20:28 +0200 |
commit | ae86557de53a8762924f18c78a556e2d6881002a (patch) | |
tree | 19199ae9759689a3fb63a8916ca2c3b6eb4ab1cf /oox | |
parent | 96c54dc16b6870a634b2779b954d7eca35d5a606 (diff) |
sd pptm: Add a separate PPTM filter.
Similarly to commit 697173f6fdfae581022cfdb5ec5171c5a3be58f0, we have to
preserve the correct content-type which is not the same for PPTX and PPTM.
This commit also changes sdfilt.component to use the constructor feature.
Change-Id: I4b334540ec07a53d308e6b9dd6403294842bddf8
Reviewed-on: https://gerrit.libreoffice.org/40195
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/core/filterdetect.cxx | 6 | ||||
-rw-r--r-- | oox/source/ppt/pptimport.cxx | 18 |
2 files changed, 18 insertions, 6 deletions
diff --git a/oox/source/core/filterdetect.cxx b/oox/source/core/filterdetect.cxx index 88d3926a2656..3b7fe2bfa737 100644 --- a/oox/source/core/filterdetect.cxx +++ b/oox/source/core/filterdetect.cxx @@ -197,10 +197,12 @@ OUString FilterDetectDocHandler::getFilterNameFromContentType( const OUString& r if ( rContentType == "application/vnd.ms-excel.sheet.binary.macroEnabled.main" ) return OUString( "MS Excel 2007 Binary" ); - if( rContentType == "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml" || - rContentType == "application/vnd.ms-powerpoint.presentation.macroEnabled.main+xml" ) + if (rContentType == "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml") return OUString( "MS PowerPoint 2007 XML" ); + if (rContentType == "application/vnd.ms-powerpoint.presentation.macroEnabled.main+xml") + return OUString( "MS PowerPoint 2007 XML VBA" ); + if( rContentType == "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml" || rContentType == "application/vnd.ms-powerpoint.slideshow.macroEnabled.main+xml" ) return OUString( "MS PowerPoint 2007 XML AutoPlay" ); diff --git a/oox/source/ppt/pptimport.cxx b/oox/source/ppt/pptimport.cxx index 2b2619acd749..920aa43e60fc 100644 --- a/oox/source/ppt/pptimport.cxx +++ b/oox/source/ppt/pptimport.cxx @@ -21,6 +21,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/uno/XComponentContext.hpp> +#include <comphelper/propertysequence.hxx> #include <osl/diagnose.h> #include <vcl/msgbox.hxx> #include <vcl/svapp.hxx> @@ -175,14 +176,23 @@ sal_Bool SAL_CALL PowerPointImport::filter( const Sequence< PropertyValue >& rDe if( XmlFilterBase::filter( rDescriptor ) ) return true; - if( isExportFilter() ) { - Reference< XExporter > xExporter( Reference<css::lang::XMultiServiceFactory>(getComponentContext()->getServiceManager(), UNO_QUERY_THROW)->createInstance( "com.sun.star.comp.Impress.oox.PowerPointExport" ), UNO_QUERY ); + if (isExportFilter()) + { + uno::Sequence<uno::Any> aArguments(comphelper::InitAnySequence( + { + {"IsPPTM", uno::makeAny(exportVBA())}, + })); + + Reference<css::lang::XMultiServiceFactory> aFactory(getComponentContext()->getServiceManager(), UNO_QUERY_THROW); + Reference< XExporter > xExporter(aFactory->createInstanceWithArguments("com.sun.star.comp.Impress.oox.PowerPointExport", aArguments), UNO_QUERY); - if( xExporter.is() ) { + if (xExporter.is()) + { Reference< XComponent > xDocument( getModel(), UNO_QUERY ); Reference< XFilter > xFilter( xExporter, UNO_QUERY ); - if( xFilter.is() ) { + if (xFilter.is()) + { xExporter->setSourceDocument( xDocument ); if( xFilter->filter( rDescriptor ) ) return true; |