diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-05-31 16:00:42 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-05-31 18:11:29 +0200 |
commit | 4e5e40e4c627775caf039870bcc28269a0d05937 (patch) | |
tree | 7d0314d901276847632bad63ea0890cea07241bd | |
parent | ff6645da1c27990a223f05185acc1d077eaf96e6 (diff) |
In ShapeExport, use general com.sun.star.comp.oox.xls.ExcelFilter
...instead of its export-only part com.sun.star.comp.oox.ExcelFilterExport (for
which even a new-style service com.sun.star.oox.ExcelFilterExport has been
introduced recently, but all of this should probably go away again; that this
filter is used explicitly is probably a rare enough scenario to not warrant a
dedicated new-style service).
The modified code in ShapeExport::WriteOLE2Shape is triggered e.g. with a
Presetation, insert a Spreadsheet as an OLE Object, and save as "Office Open XML
Presentation (.pptx)."
Change-Id: Id2645972caaec5265eed645c9c6e2c308a4d079d
-rw-r--r-- | oox/source/export/shapes.cxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index d4b65ff140c3..74fa5b945357 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -46,7 +46,6 @@ #include <com/sun/star/graphic/XGraphic.hpp> #include <com/sun/star/i18n/ScriptType.hpp> #include <com/sun/star/io/XOutputStream.hpp> -#include <com/sun/star/oox/ExcelFilterExport.hpp> #include <com/sun/star/sheet/XSpreadsheetDocument.hpp> #include <com/sun/star/style/ParagraphAdjust.hpp> #include <com/sun/star/text/XSimpleText.hpp> @@ -1311,7 +1310,6 @@ ShapeExport& ShapeExport::WriteOLE2Shape( Reference< XShape > xShape ) if( xSheetDoc.is() && mpFB) { Reference< XComponent > xDocument( mAny, UNO_QUERY ); - Reference< XExporter > xExporter = css::oox::ExcelFilterExport::create( mpFB->getComponentContext() ); if( xDocument.is() ) { Reference< XOutputStream > xOutStream = mpFB->openFragmentStream( OUStringBuffer() @@ -1327,13 +1325,15 @@ ShapeExport& ShapeExport::WriteOLE2Shape( Reference< XShape > xShape ) rMedia[0].Name = MediaDescriptor::PROP_STREAMFOROUTPUT(); rMedia[0].Value <<= xOutStream; - Reference< XFilter > xFilter( xExporter, UNO_QUERY ); - - if( xFilter.is() ) - { - xExporter->setSourceDocument( xDocument ); - xFilter->filter( rMedia ); - } + Reference< XExporter > xExporter( + mpFB->getComponentContext()->getServiceManager()-> + createInstanceWithContext( + "com.sun.star.comp.oox.xls.ExcelFilter", + mpFB->getComponentContext() ), + UNO_QUERY_THROW ); + xExporter->setSourceDocument( xDocument ); + Reference< XFilter >( xExporter, UNO_QUERY_THROW )-> + filter( rMedia ); xOutStream->closeOutput(); |