diff options
author | Jan Holesovsky <kendy@collabora.com> | 2017-07-19 08:42:36 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2017-07-21 19:46:41 +0200 |
commit | 5d0901a75e7ef96dc722b5277450cc18ad163f7b (patch) | |
tree | 10196f12c94e0f4680ffcd59e1b3c712853d6d70 /oox | |
parent | 7b0607aa7d42e3ea4c1623d65b124970abc04d79 (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>
Reviewed-on: https://gerrit.libreoffice.org/40265
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
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 f36c6496157f..24e47c1ca7c2 100644 --- a/oox/source/core/filterdetect.cxx +++ b/oox/source/core/filterdetect.cxx @@ -192,10 +192,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 30d3d2951b24..446a054ffd91 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> @@ -216,14 +217,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; |