diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-05-30 14:34:51 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-05-30 19:01:31 +0200 |
commit | 80138cb6330e4c6a516d571941f25d47afbee786 (patch) | |
tree | 9b61671b092c174802ac5126d2e823c5e7ea732b | |
parent | Clean up for consistency (diff) | |
download | core-80138cb6330e4c6a516d571941f25d47afbee786.tar.gz core-80138cb6330e4c6a516d571941f25d47afbee786.zip |
Clean up scfilt_component_getFactory
Change-Id: I1f1be2cdc10e6ec386cc5d2e71c1e189a987df56
-rw-r--r-- | sc/Library_scfilt.mk | 1 | ||||
-rw-r--r-- | sc/source/filter/excel/xestream.cxx | 44 | ||||
-rw-r--r-- | sc/source/filter/inc/excelfilter.hxx | 7 | ||||
-rw-r--r-- | sc/source/filter/inc/xestream.hxx | 7 | ||||
-rw-r--r-- | sc/source/filter/oox/excelfilter.cxx | 8 | ||||
-rw-r--r-- | sc/source/filter/services.cxx | 47 |
6 files changed, 68 insertions, 46 deletions
diff --git a/sc/Library_scfilt.mk b/sc/Library_scfilt.mk index 318d69e04ade..0374c7c0a433 100644 --- a/sc/Library_scfilt.mk +++ b/sc/Library_scfilt.mk @@ -221,6 +221,7 @@ $(eval $(call gb_Library_add_exception_objects,scfilt,\ sc/source/filter/orcus/interface \ sc/source/filter/orcus/orcusfiltersimpl \ sc/source/filter/orcus/xmlcontext \ + sc/source/filter/services \ )) ifeq ($(SYSTEM_ZLIB),YES) diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx index cc4678f3eabf..178da4ed2d05 100644 --- a/sc/source/filter/excel/xestream.cxx +++ b/sc/source/filter/excel/xestream.cxx @@ -52,7 +52,6 @@ #include <sfx2/docfile.hxx> #include <sfx2/objsh.hxx> #include <sfx2/app.hxx> -#include <cppuhelper/implementationentry.hxx> #define DEBUG_XL_ENCRYPTION 0 @@ -1162,7 +1161,7 @@ OUString XclExpXmlStream::implGetImplementationName() const } -Sequence< OUString > SAL_CALL XlsxExport_getSupportedServiceNames() throw() +Sequence< OUString > XlsxExport_getSupportedServiceNames() { Sequence< OUString > aSeq( 2 ); aSeq[0] = "com.sun.star.document.ExportFilter"; @@ -1170,48 +1169,9 @@ Sequence< OUString > SAL_CALL XlsxExport_getSupportedServiceNames() throw() return aSeq; } -Reference< XInterface > SAL_CALL XlsxExport_createInstance(const Reference< XComponentContext > & rCC ) throw( Exception ) +Reference< XInterface > SAL_CALL XlsxExport_create(const Reference< XComponentContext > & rCC ) { return (cppu::OWeakObject*) new XclExpXmlStream( rCC ); } -namespace oox { namespace xls { - OUString SAL_CALL ExcelFilter_getImplementationName() throw(); - Sequence< OUString > SAL_CALL ExcelFilter_getSupportedServiceNames() throw(); - Reference< XInterface > SAL_CALL ExcelFilter_createInstance( - const Reference< XComponentContext >& rxContext ) throw( Exception ); -} } - -#ifdef __cplusplus -extern "C" -{ -#endif - -// ------------------------ -// - component_getFactory - -// ------------------------ -::cppu::ImplementationEntry entries [] = -{ - { - XlsxExport_createInstance, XlsxExport_getImplementationName, - XlsxExport_getSupportedServiceNames, ::cppu::createSingleComponentFactory, - 0, 0 - }, - { - oox::xls::ExcelFilter_createInstance, oox::xls::ExcelFilter_getImplementationName, - oox::xls::ExcelFilter_getSupportedServiceNames, ::cppu::createSingleComponentFactory, - 0, 0 - }, - { 0, 0, 0, 0, 0, 0 } -}; - -SAL_DLLPUBLIC_EXPORT void* SAL_CALL scfilt_component_getFactory( const sal_Char* pImplName, XMultiServiceFactory* pServiceManager, XRegistryKey* pRegistryKey ) -{ - return ::cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey, entries ); - -} - -#ifdef __cplusplus -} -#endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/inc/excelfilter.hxx b/sc/source/filter/inc/excelfilter.hxx index fc108c311f09..6423996c92a9 100644 --- a/sc/source/filter/inc/excelfilter.hxx +++ b/sc/source/filter/inc/excelfilter.hxx @@ -70,6 +70,13 @@ private: virtual OUString implGetImplementationName() const; }; +css::uno::Reference< css::uno::XInterface > SAL_CALL ExcelFilter_create( + css::uno::Reference< css::uno::XComponentContext > const & context); + +OUString SAL_CALL ExcelFilter_getImplementationName(); + +css::uno::Sequence< OUString > SAL_CALL ExcelFilter_getSupportedServiceNames(); + } // namespace xls } // namespace oox diff --git a/sc/source/filter/inc/xestream.hxx b/sc/source/filter/inc/xestream.hxx index 0ac31d4617f1..aed9dde78f5a 100644 --- a/sc/source/filter/inc/xestream.hxx +++ b/sc/source/filter/inc/xestream.hxx @@ -381,6 +381,13 @@ private: XclExpXmlPathToStateMap maOpenedStreamMap; }; +css::uno::Reference< css::uno::XInterface > SAL_CALL XlsxExport_create( + css::uno::Reference< css::uno::XComponentContext > const & context); + +OUString SAL_CALL XlsxExport_getImplementationName(); + +css::uno::Sequence< OUString > SAL_CALL XlsxExport_getSupportedServiceNames(); + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/oox/excelfilter.cxx b/sc/source/filter/oox/excelfilter.cxx index e8414cb15584..630e9d25d9ba 100644 --- a/sc/source/filter/oox/excelfilter.cxx +++ b/sc/source/filter/oox/excelfilter.cxx @@ -73,12 +73,12 @@ void ExcelFilterBase::unregisterWorkbookGlobals() // ============================================================================ -OUString SAL_CALL ExcelFilter_getImplementationName() throw() +OUString ExcelFilter_getImplementationName() { return OUString( "com.sun.star.comp.oox.xls.ExcelFilter" ); } -Sequence< OUString > SAL_CALL ExcelFilter_getSupportedServiceNames() throw() +Sequence< OUString > ExcelFilter_getSupportedServiceNames() { Sequence< OUString > aSeq( 2 ); aSeq[ 0 ] = "com.sun.star.document.ImportFilter"; @@ -86,8 +86,8 @@ Sequence< OUString > SAL_CALL ExcelFilter_getSupportedServiceNames() throw() return aSeq; } -Reference< XInterface > SAL_CALL ExcelFilter_createInstance( - const Reference< XComponentContext >& rxContext ) throw( Exception ) +Reference< XInterface > ExcelFilter_create( + const Reference< XComponentContext >& rxContext ) { return static_cast< ::cppu::OWeakObject* >( new ExcelFilter( rxContext ) ); } diff --git a/sc/source/filter/services.cxx b/sc/source/filter/services.cxx new file mode 100644 index 000000000000..33a01840d2b9 --- /dev/null +++ b/sc/source/filter/services.cxx @@ -0,0 +1,47 @@ +/* -*- 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 . + */ + +#include "sal/config.h" + +#include "cppuhelper/factory.hxx" +#include "cppuhelper/implementationentry.hxx" +#include "sal/types.h" + +#include "excelfilter.hxx" +#include "xestream.hxx" + +extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL scfilt_component_getFactory( + char const * pImplName, void * pServiceManager, void * pRegistryKey) +{ + static cppu::ImplementationEntry const services[] = { + { XlsxExport_create, XlsxExport_getImplementationName, + XlsxExport_getSupportedServiceNames, + cppu::createSingleComponentFactory, 0, 0 }, + { oox::xls::ExcelFilter_create, + oox::xls::ExcelFilter_getImplementationName, + oox::xls::ExcelFilter_getSupportedServiceNames, + cppu::createSingleComponentFactory, 0, 0 }, + { 0, 0, 0, 0, 0, 0 } + }; + return cppu::component_getFactoryHelper( + pImplName, pServiceManager, pRegistryKey, services); + +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |