Kaydet (Commit) 4e5e40e4 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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
üst ff6645da
...@@ -46,7 +46,6 @@ ...@@ -46,7 +46,6 @@
#include <com/sun/star/graphic/XGraphic.hpp> #include <com/sun/star/graphic/XGraphic.hpp>
#include <com/sun/star/i18n/ScriptType.hpp> #include <com/sun/star/i18n/ScriptType.hpp>
#include <com/sun/star/io/XOutputStream.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/sheet/XSpreadsheetDocument.hpp>
#include <com/sun/star/style/ParagraphAdjust.hpp> #include <com/sun/star/style/ParagraphAdjust.hpp>
#include <com/sun/star/text/XSimpleText.hpp> #include <com/sun/star/text/XSimpleText.hpp>
...@@ -1311,7 +1310,6 @@ ShapeExport& ShapeExport::WriteOLE2Shape( Reference< XShape > xShape ) ...@@ -1311,7 +1310,6 @@ ShapeExport& ShapeExport::WriteOLE2Shape( Reference< XShape > xShape )
if( xSheetDoc.is() && mpFB) if( xSheetDoc.is() && mpFB)
{ {
Reference< XComponent > xDocument( mAny, UNO_QUERY ); Reference< XComponent > xDocument( mAny, UNO_QUERY );
Reference< XExporter > xExporter = css::oox::ExcelFilterExport::create( mpFB->getComponentContext() );
if( xDocument.is() ) if( xDocument.is() )
{ {
Reference< XOutputStream > xOutStream = mpFB->openFragmentStream( OUStringBuffer() Reference< XOutputStream > xOutStream = mpFB->openFragmentStream( OUStringBuffer()
...@@ -1327,13 +1325,15 @@ ShapeExport& ShapeExport::WriteOLE2Shape( Reference< XShape > xShape ) ...@@ -1327,13 +1325,15 @@ ShapeExport& ShapeExport::WriteOLE2Shape( Reference< XShape > xShape )
rMedia[0].Name = MediaDescriptor::PROP_STREAMFOROUTPUT(); rMedia[0].Name = MediaDescriptor::PROP_STREAMFOROUTPUT();
rMedia[0].Value <<= xOutStream; rMedia[0].Value <<= xOutStream;
Reference< XFilter > xFilter( xExporter, UNO_QUERY ); Reference< XExporter > xExporter(
mpFB->getComponentContext()->getServiceManager()->
if( xFilter.is() ) createInstanceWithContext(
{ "com.sun.star.comp.oox.xls.ExcelFilter",
xExporter->setSourceDocument( xDocument ); mpFB->getComponentContext() ),
xFilter->filter( rMedia ); UNO_QUERY_THROW );
} xExporter->setSourceDocument( xDocument );
Reference< XFilter >( xExporter, UNO_QUERY_THROW )->
filter( rMedia );
xOutStream->closeOutput(); xOutStream->closeOutput();
......
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