Kaydet (Commit) a986eddb authored tarafından Noel Grandin's avatar Noel Grandin

fdo#46808, Convert oox.ExcelFilterExport service to new style

Service already existed, just needed an IDL file

Change-Id: I397296e5ad7b32febb63e74f8ee9a0db53ba5a81
üst d4d16d8a
...@@ -260,6 +260,9 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/media,\ ...@@ -260,6 +260,9 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/media,\
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/mozilla,\ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/mozilla,\
MozillaBootstrap \ MozillaBootstrap \
)) ))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/oox,\
ExcelFilterExport \
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/packages/manifest,\ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/packages/manifest,\
ManifestReader \ ManifestReader \
ManifestWriter \ ManifestWriter \
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef __com_sun_star_oox_ExcelFilterExport_idl__
#define __com_sun_star_oox_ExcelFilterExport_idl__
#include <com/sun/star/document/XExporter.idl>
module com { module sun { module star { module oox {
/**
@since LibreOffice 4.2
*/
service ExcelFilterExport : com::sun::star::document::XExporter;
}; }; }; };
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#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>
...@@ -1312,8 +1313,8 @@ ShapeExport& ShapeExport::WriteOLE2Shape( Reference< XShape > xShape ) ...@@ -1312,8 +1313,8 @@ 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( Reference<css::lang::XMultiServiceFactory>(mpFB->getComponentContext()->getServiceManager(), UNO_QUERY_THROW)->createInstance( "com.sun.star.comp.oox.ExcelFilterExport" ), UNO_QUERY );; Reference< XExporter > xExporter = css::oox::ExcelFilterExport::create( mpFB->getComponentContext() );
if( xDocument.is() && xExporter.is()) if( xDocument.is() )
{ {
Reference< XOutputStream > xOutStream = mpFB->openFragmentStream( OUStringBuffer() Reference< XOutputStream > xOutStream = mpFB->openFragmentStream( OUStringBuffer()
.appendAscii( GetComponentDir() ) .appendAscii( GetComponentDir() )
......
...@@ -1146,11 +1146,9 @@ bool XclExpXmlStream::exportDocument() throw() ...@@ -1146,11 +1146,9 @@ bool XclExpXmlStream::exportDocument() throw()
// UNO stuff so that the filter is registered // UNO stuff so that the filter is registered
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
#define IMPL_NAME "com.sun.star.comp.oox.ExcelFilterExport"
OUString XlsxExport_getImplementationName() OUString XlsxExport_getImplementationName()
{ {
return OUString( IMPL_NAME ); return OUString( "com.sun.star.comp.oox.ExcelFilterExport" );
} }
::oox::ole::VbaProject* XclExpXmlStream::implCreateVbaProject() const ::oox::ole::VbaProject* XclExpXmlStream::implCreateVbaProject() const
...@@ -1166,8 +1164,9 @@ OUString XclExpXmlStream::implGetImplementationName() const ...@@ -1166,8 +1164,9 @@ OUString XclExpXmlStream::implGetImplementationName() const
Sequence< OUString > SAL_CALL XlsxExport_getSupportedServiceNames() throw() Sequence< OUString > SAL_CALL XlsxExport_getSupportedServiceNames() throw()
{ {
const OUString aServiceName( "com.sun.star.document.ExportFilter" ); Sequence< OUString > aSeq( 2 );
const Sequence< OUString > aSeq( &aServiceName, 1 ); aSeq[0] = "com.sun.star.document.ExportFilter";
aSeq[1] = "com.sun.star.oox.ExcelFilterExport";
return aSeq; return aSeq;
} }
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
#include "excelfilter.hxx" #include "excelfilter.hxx"
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp> #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include <com/sun/star/oox/ExcelFilterExport.hpp>
#include "oox/helper/binaryinputstream.hxx" #include "oox/helper/binaryinputstream.hxx"
#include "biffinputstream.hxx" #include "biffinputstream.hxx"
#include "excelchartconverter.hxx" #include "excelchartconverter.hxx"
...@@ -175,19 +177,16 @@ sal_Bool SAL_CALL ExcelFilter::filter( const ::com::sun::star::uno::Sequence< :: ...@@ -175,19 +177,16 @@ sal_Bool SAL_CALL ExcelFilter::filter( const ::com::sun::star::uno::Sequence< ::
if ( isExportFilter() ) 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 ); xExporter->setSourceDocument( xDocument );
Reference< XFilter > xFilter( xExporter, UNO_QUERY ); if ( xFilter->filter( rDescriptor ) )
return true;
if ( xFilter.is() )
{
xExporter->setSourceDocument( xDocument );
if ( xFilter->filter( rDescriptor ) )
return true;
}
} }
} }
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<component loader="com.sun.star.loader.SharedLibrary" prefix="scfilt" <component loader="com.sun.star.loader.SharedLibrary" prefix="scfilt"
xmlns="http://openoffice.org/2010/uno-components"> xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.oox.ExcelFilterExport"> <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>
<implementation name="com.sun.star.comp.oox.xls.ExcelFilter"> <implementation name="com.sun.star.comp.oox.xls.ExcelFilter">
<service name="com.sun.star.document.ImportFilter"/> <service name="com.sun.star.document.ImportFilter"/>
......
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