diff options
author | Noel Grandin <noel@peralex.com> | 2013-05-21 13:08:34 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-05-21 13:53:20 +0200 |
commit | a986eddb9b9d1de71ae1c6f73246e493cc449c21 (patch) | |
tree | ad9221c84bcc6d1c49b2cb8328b42d7c20226522 /sc | |
parent | d4d16d8a27517930bdc9e9a308da287d367dd622 (diff) |
fdo#46808, Convert oox.ExcelFilterExport service to new style
Service already existed, just needed an IDL file
Change-Id: I397296e5ad7b32febb63e74f8ee9a0db53ba5a81
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/excel/xestream.cxx | 9 | ||||
-rw-r--r-- | sc/source/filter/oox/excelfilter.cxx | 21 | ||||
-rw-r--r-- | sc/util/scfilt.component | 2 |
3 files changed, 15 insertions, 17 deletions
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx index dacbb1dfd8f6..cc4678f3eabf 100644 --- a/sc/source/filter/excel/xestream.cxx +++ b/sc/source/filter/excel/xestream.cxx @@ -1146,11 +1146,9 @@ bool XclExpXmlStream::exportDocument() throw() // UNO stuff so that the filter is registered ////////////////////////////////////////////////////////////////////////// -#define IMPL_NAME "com.sun.star.comp.oox.ExcelFilterExport" - OUString XlsxExport_getImplementationName() { - return OUString( IMPL_NAME ); + return OUString( "com.sun.star.comp.oox.ExcelFilterExport" ); } ::oox::ole::VbaProject* XclExpXmlStream::implCreateVbaProject() const @@ -1166,8 +1164,9 @@ OUString XclExpXmlStream::implGetImplementationName() const Sequence< OUString > SAL_CALL XlsxExport_getSupportedServiceNames() throw() { - const OUString aServiceName( "com.sun.star.document.ExportFilter" ); - const Sequence< OUString > aSeq( &aServiceName, 1 ); + Sequence< OUString > aSeq( 2 ); + aSeq[0] = "com.sun.star.document.ExportFilter"; + aSeq[1] = "com.sun.star.oox.ExcelFilterExport"; return aSeq; } diff --git a/sc/source/filter/oox/excelfilter.cxx b/sc/source/filter/oox/excelfilter.cxx index 379b323d9e2a..e8414cb15584 100644 --- a/sc/source/filter/oox/excelfilter.cxx +++ b/sc/source/filter/oox/excelfilter.cxx @@ -20,6 +20,8 @@ #include "excelfilter.hxx" #include <com/sun/star/sheet/XSpreadsheetDocument.hpp> +#include <com/sun/star/oox/ExcelFilterExport.hpp> + #include "oox/helper/binaryinputstream.hxx" #include "biffinputstream.hxx" #include "excelchartconverter.hxx" @@ -175,19 +177,16 @@ sal_Bool SAL_CALL ExcelFilter::filter( const ::com::sun::star::uno::Sequence< :: if ( isExportFilter() ) { - Reference< XExporter > xExporter( Reference<XMultiServiceFactory>(getComponentContext()->getServiceManager(), UNO_QUERY_THROW)->createInstance( "com.sun.star.comp.oox.ExcelFilterExport" ), UNO_QUERY );; + Reference< XExporter > xExporter = css::oox::ExcelFilterExport::create( getComponentContext() ); + + Reference< XComponent > xDocument( getModel(), UNO_QUERY ); + Reference< XFilter > xFilter( xExporter, UNO_QUERY ); - if ( xExporter.is() ) + if ( xFilter.is() ) { - Reference< XComponent > xDocument( getModel(), UNO_QUERY ); - Reference< XFilter > xFilter( xExporter, UNO_QUERY ); - - if ( xFilter.is() ) - { - xExporter->setSourceDocument( xDocument ); - if ( xFilter->filter( rDescriptor ) ) - return true; - } + xExporter->setSourceDocument( xDocument ); + if ( xFilter->filter( rDescriptor ) ) + return true; } } diff --git a/sc/util/scfilt.component b/sc/util/scfilt.component index 292fbd49cd33..6834ce1578ec 100644 --- a/sc/util/scfilt.component +++ b/sc/util/scfilt.component @@ -20,7 +20,7 @@ <component loader="com.sun.star.loader.SharedLibrary" prefix="scfilt" xmlns="http://openoffice.org/2010/uno-components"> <implementation name="com.sun.star.comp.oox.ExcelFilterExport"> - <service name="com.sun.star.comp.oox.ExcelFilterExport"/> + <service name="com.sun.star.oox.ExcelFilterExport"/> </implementation> <implementation name="com.sun.star.comp.oox.xls.ExcelFilter"> <service name="com.sun.star.document.ImportFilter"/> |