diff options
author | David Tardon <dtardon@redhat.com> | 2016-02-08 08:29:04 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2016-02-08 09:37:14 +0100 |
commit | 9332b254c1b96ad030106b79a52dc8915b70091f (patch) | |
tree | 037fd5e9cd3791c5685a9401b26eaf25ef7a6b04 /writerperfect | |
parent | eff6d8213665c7b955fddadc1f446c76b0074924 (diff) |
wpftcalc: use service constructor
Change-Id: Ic93e932c89b7962243e84aa50431d0e8deb1b499
Diffstat (limited to 'writerperfect')
-rw-r--r-- | writerperfect/Library_wpftcalc.mk | 1 | ||||
-rw-r--r-- | writerperfect/source/calc/MSWorksCalcImportFilter.cxx | 41 | ||||
-rw-r--r-- | writerperfect/source/calc/MSWorksCalcImportFilter.hxx | 10 | ||||
-rw-r--r-- | writerperfect/source/calc/MWAWCalcImportFilter.cxx | 41 | ||||
-rw-r--r-- | writerperfect/source/calc/MWAWCalcImportFilter.hxx | 10 | ||||
-rw-r--r-- | writerperfect/source/calc/NumbersImportFilter.cxx | 41 | ||||
-rw-r--r-- | writerperfect/source/calc/NumbersImportFilter.hxx | 10 | ||||
-rw-r--r-- | writerperfect/source/calc/wpftcalc.component | 11 | ||||
-rw-r--r-- | writerperfect/source/calc/wpftcalc_genericfilter.cxx | 68 |
9 files changed, 58 insertions, 175 deletions
diff --git a/writerperfect/Library_wpftcalc.mk b/writerperfect/Library_wpftcalc.mk index 18cc378e8f91..1672e63f2c33 100644 --- a/writerperfect/Library_wpftcalc.mk +++ b/writerperfect/Library_wpftcalc.mk @@ -61,7 +61,6 @@ $(eval $(call gb_Library_add_exception_objects,wpftcalc,\ writerperfect/source/calc/MSWorksCalcImportFilter \ writerperfect/source/calc/MWAWCalcImportFilter \ writerperfect/source/calc/NumbersImportFilter \ - writerperfect/source/calc/wpftcalc_genericfilter \ )) # vim: set noet sw=4 ts=4: diff --git a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx index c17941434d4e..1d88c05622cf 100644 --- a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx +++ b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx @@ -109,43 +109,36 @@ void MSWorksCalcImportFilter::doRegisterHandlers(OdsGenerator &) { } -OUString MSWorksCalcImportFilter_getImplementationName() -throw (RuntimeException) -{ - return OUString("com.sun.star.comp.Calc.MSWorksCalcImportFilter"); -} - -Sequence< OUString > SAL_CALL MSWorksCalcImportFilter_getSupportedServiceNames() -throw (RuntimeException) -{ - Sequence < OUString > aRet(2); - OUString *pArray = aRet.getArray(); - pArray[0] = "com.sun.star.document.ImportFilter"; - pArray[1] = "com.sun.star.document.ExtendedTypeDetection"; - return aRet; -} - -Reference< XInterface > SAL_CALL MSWorksCalcImportFilter_createInstance(const Reference< XComponentContext > &rContext) -throw(Exception) -{ - return static_cast<cppu::OWeakObject *>(new MSWorksCalcImportFilter(rContext)); -} - // XServiceInfo OUString SAL_CALL MSWorksCalcImportFilter::getImplementationName() throw (RuntimeException, std::exception) { - return MSWorksCalcImportFilter_getImplementationName(); + return OUString("com.sun.star.comp.Calc.MSWorksCalcImportFilter"); } + sal_Bool SAL_CALL MSWorksCalcImportFilter::supportsService(const OUString &rServiceName) throw (RuntimeException, std::exception) { return cppu::supportsService(this, rServiceName); } + Sequence< OUString > SAL_CALL MSWorksCalcImportFilter::getSupportedServiceNames() throw (RuntimeException, std::exception) { - return MSWorksCalcImportFilter_getSupportedServiceNames(); + Sequence < OUString > aRet(2); + OUString *pArray = aRet.getArray(); + pArray[0] = "com.sun.star.document.ImportFilter"; + pArray[1] = "com.sun.star.document.ExtendedTypeDetection"; + return aRet; +} + +extern "C" +SAL_DLLPUBLIC_EXPORT css::uno::XInterface *SAL_CALL +com_sun_star_comp_Calc_MSWorksCalcImportFilter_get_implementation( + css::uno::XComponentContext *const context, + const css::uno::Sequence<css::uno::Any> &) +{ + return cppu::acquire(new MSWorksCalcImportFilter(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerperfect/source/calc/MSWorksCalcImportFilter.hxx b/writerperfect/source/calc/MSWorksCalcImportFilter.hxx index 31462c341145..8eda909a1d55 100644 --- a/writerperfect/source/calc/MSWorksCalcImportFilter.hxx +++ b/writerperfect/source/calc/MSWorksCalcImportFilter.hxx @@ -40,16 +40,6 @@ private: virtual void doRegisterHandlers(OdsGenerator &rGenerator) override; }; -OUString MSWorksCalcImportFilter_getImplementationName() -throw (css::uno::RuntimeException); - -css::uno::Sequence< OUString > SAL_CALL MSWorksCalcImportFilter_getSupportedServiceNames() -throw (css::uno::RuntimeException); - -css::uno::Reference< css::uno::XInterface > -SAL_CALL MSWorksCalcImportFilter_createInstance(const css::uno::Reference< css::uno::XComponentContext > &rContext) -throw (css::uno::Exception); - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerperfect/source/calc/MWAWCalcImportFilter.cxx b/writerperfect/source/calc/MWAWCalcImportFilter.cxx index ee0d646cde47..c1034b1e0625 100644 --- a/writerperfect/source/calc/MWAWCalcImportFilter.cxx +++ b/writerperfect/source/calc/MWAWCalcImportFilter.cxx @@ -101,43 +101,36 @@ void MWAWCalcImportFilter::doRegisterHandlers(OdsGenerator &rGenerator) rGenerator.registerEmbeddedObjectHandler("image/mwaw-ods", &handleEmbeddedMWAWSpreadsheetObject); } -OUString MWAWCalcImportFilter_getImplementationName() -throw (RuntimeException) -{ - return OUString("com.sun.star.comp.Calc.MWAWCalcImportFilter"); -} - -Sequence< OUString > SAL_CALL MWAWCalcImportFilter_getSupportedServiceNames() -throw (RuntimeException) -{ - Sequence < OUString > aRet(2); - OUString *pArray = aRet.getArray(); - pArray[0] = "com.sun.star.document.ImportFilter"; - pArray[1] = "com.sun.star.document.ExtendedTypeDetection"; - return aRet; -} - -Reference< XInterface > SAL_CALL MWAWCalcImportFilter_createInstance(const Reference< XComponentContext > &rContext) -throw(Exception) -{ - return static_cast<cppu::OWeakObject *>(new MWAWCalcImportFilter(rContext)); -} - // XServiceInfo OUString SAL_CALL MWAWCalcImportFilter::getImplementationName() throw (RuntimeException, std::exception) { - return MWAWCalcImportFilter_getImplementationName(); + return OUString("com.sun.star.comp.Calc.MWAWCalcImportFilter"); } + sal_Bool SAL_CALL MWAWCalcImportFilter::supportsService(const OUString &rServiceName) throw (RuntimeException, std::exception) { return cppu::supportsService(this, rServiceName); } + Sequence< OUString > SAL_CALL MWAWCalcImportFilter::getSupportedServiceNames() throw (RuntimeException, std::exception) { - return MWAWCalcImportFilter_getSupportedServiceNames(); + Sequence < OUString > aRet(2); + OUString *pArray = aRet.getArray(); + pArray[0] = "com.sun.star.document.ImportFilter"; + pArray[1] = "com.sun.star.document.ExtendedTypeDetection"; + return aRet; +} + +extern "C" +SAL_DLLPUBLIC_EXPORT css::uno::XInterface *SAL_CALL +com_sun_star_comp_Calc_MWAWCalcImportFilter_get_implementation( + css::uno::XComponentContext *const context, + const css::uno::Sequence<css::uno::Any> &) +{ + return cppu::acquire(new MWAWCalcImportFilter(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerperfect/source/calc/MWAWCalcImportFilter.hxx b/writerperfect/source/calc/MWAWCalcImportFilter.hxx index 2a8be14861a1..5b24292a567e 100644 --- a/writerperfect/source/calc/MWAWCalcImportFilter.hxx +++ b/writerperfect/source/calc/MWAWCalcImportFilter.hxx @@ -40,16 +40,6 @@ private: virtual void doRegisterHandlers(OdsGenerator &rGenerator) override; }; -OUString MWAWCalcImportFilter_getImplementationName() -throw (css::uno::RuntimeException); - -css::uno::Sequence< OUString > SAL_CALL MWAWCalcImportFilter_getSupportedServiceNames() -throw (css::uno::RuntimeException); - -css::uno::Reference< css::uno::XInterface > -SAL_CALL MWAWCalcImportFilter_createInstance(const css::uno::Reference< css::uno::XComponentContext > &rContext) -throw (css::uno::Exception); - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerperfect/source/calc/NumbersImportFilter.cxx b/writerperfect/source/calc/NumbersImportFilter.cxx index ba8cf0e83fac..cf24f8a7bb7a 100644 --- a/writerperfect/source/calc/NumbersImportFilter.cxx +++ b/writerperfect/source/calc/NumbersImportFilter.cxx @@ -49,43 +49,36 @@ void NumbersImportFilter::doRegisterHandlers(OdsGenerator &) { } -OUString NumbersImportFilter_getImplementationName() -throw (RuntimeException) -{ - return OUString("org.libreoffice.comp.Calc.NumbersImportFilter"); -} - -Sequence< OUString > SAL_CALL NumbersImportFilter_getSupportedServiceNames() -throw (RuntimeException) -{ - Sequence < OUString > aRet(2); - OUString *pArray = aRet.getArray(); - pArray[0] = "com.sun.star.document.ImportFilter"; - pArray[1] = "com.sun.star.document.ExtendedTypeDetection"; - return aRet; -} - -Reference< XInterface > SAL_CALL NumbersImportFilter_createInstance(const Reference< XComponentContext > &rContext) -throw(Exception) -{ - return static_cast<cppu::OWeakObject *>(new NumbersImportFilter(rContext)); -} - // XServiceInfo OUString SAL_CALL NumbersImportFilter::getImplementationName() throw (RuntimeException, std::exception) { - return NumbersImportFilter_getImplementationName(); + return OUString("org.libreoffice.comp.Calc.NumbersImportFilter"); } + sal_Bool SAL_CALL NumbersImportFilter::supportsService(const OUString &rServiceName) throw (RuntimeException, std::exception) { return cppu::supportsService(this, rServiceName); } + Sequence< OUString > SAL_CALL NumbersImportFilter::getSupportedServiceNames() throw (RuntimeException, std::exception) { - return NumbersImportFilter_getSupportedServiceNames(); + Sequence < OUString > aRet(2); + OUString *pArray = aRet.getArray(); + pArray[0] = "com.sun.star.document.ImportFilter"; + pArray[1] = "com.sun.star.document.ExtendedTypeDetection"; + return aRet; +} + +extern "C" +SAL_DLLPUBLIC_EXPORT css::uno::XInterface *SAL_CALL +org_libreoffice_comp_Calc_NumbersImportFilter_get_implementation( + css::uno::XComponentContext *const context, + const css::uno::Sequence<css::uno::Any> &) +{ + return cppu::acquire(new NumbersImportFilter(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerperfect/source/calc/NumbersImportFilter.hxx b/writerperfect/source/calc/NumbersImportFilter.hxx index 508643b672cf..f12226ff4200 100644 --- a/writerperfect/source/calc/NumbersImportFilter.hxx +++ b/writerperfect/source/calc/NumbersImportFilter.hxx @@ -39,16 +39,6 @@ private: virtual void doRegisterHandlers(OdsGenerator &rGenerator) override; }; -OUString NumbersImportFilter_getImplementationName() -throw (css::uno::RuntimeException); - -css::uno::Sequence< OUString > SAL_CALL NumbersImportFilter_getSupportedServiceNames() -throw (css::uno::RuntimeException); - -css::uno::Reference< css::uno::XInterface > -SAL_CALL NumbersImportFilter_createInstance(const css::uno::Reference< css::uno::XComponentContext > &rContext) -throw (css::uno::Exception); - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerperfect/source/calc/wpftcalc.component b/writerperfect/source/calc/wpftcalc.component index 9216b33526f8..117ec1f80288 100644 --- a/writerperfect/source/calc/wpftcalc.component +++ b/writerperfect/source/calc/wpftcalc.component @@ -8,16 +8,19 @@ * --> <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" - prefix="wpftcalc" xmlns="http://openoffice.org/2010/uno-components"> - <implementation name="com.sun.star.comp.Calc.MSWorksCalcImportFilter"> + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.Calc.MSWorksCalcImportFilter" + constructor="com_sun_star_comp_Calc_MSWorksCalcImportFilter_get_implementation"> <service name="com.sun.star.document.ImportFilter"/> <service name="com.sun.star.document.ExtendedTypeDetection"/> </implementation> - <implementation name="com.sun.star.comp.Calc.MWAWCalcImportFilter"> + <implementation name="com.sun.star.comp.Calc.MWAWCalcImportFilter" + constructor="com_sun_star_comp_Calc_MWAWCalcImportFilter_get_implementation"> <service name="com.sun.star.document.ImportFilter"/> <service name="com.sun.star.document.ExtendedTypeDetection"/> </implementation> - <implementation name="org.libreoffice.comp.Calc.NumbersImportFilter"> + <implementation name="org.libreoffice.comp.Calc.NumbersImportFilter" + constructor="org_libreoffice_comp_Calc_NumbersImportFilter_get_implementation"> <service name="com.sun.star.document.ImportFilter"/> <service name="com.sun.star.document.ExtendedTypeDetection"/> </implementation> diff --git a/writerperfect/source/calc/wpftcalc_genericfilter.cxx b/writerperfect/source/calc/wpftcalc_genericfilter.cxx deleted file mode 100644 index 87296a02f3b1..000000000000 --- a/writerperfect/source/calc/wpftcalc_genericfilter.cxx +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- 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 . - */ - -/* genericfilter: mostly generic code for registering the filter */ - -/* "This product is not manufactured, approved, or supported by - * Corel Corporation or Corel Corporation Limited." - */ - -#include "sal/config.h" - -#include "cppuhelper/factory.hxx" -#include "cppuhelper/implementationentry.hxx" -#include "sal/types.h" - -#include "MSWorksCalcImportFilter.hxx" -#include "MWAWCalcImportFilter.hxx" -#include "NumbersImportFilter.hxx" - -namespace -{ - -static cppu::ImplementationEntry const services[] = -{ - { - &MSWorksCalcImportFilter_createInstance, &MSWorksCalcImportFilter_getImplementationName, - &MSWorksCalcImportFilter_getSupportedServiceNames, - &cppu::createSingleComponentFactory, nullptr, 0 - }, - { - &MWAWCalcImportFilter_createInstance, &MWAWCalcImportFilter_getImplementationName, - &MWAWCalcImportFilter_getSupportedServiceNames, - &cppu::createSingleComponentFactory, nullptr, 0 - }, - { - &NumbersImportFilter_createInstance, &NumbersImportFilter_getImplementationName, - &NumbersImportFilter_getSupportedServiceNames, - &cppu::createSingleComponentFactory, nullptr, 0 - }, - { nullptr, nullptr, nullptr, nullptr, nullptr, 0 } -}; - -} - -extern "C" SAL_DLLPUBLIC_EXPORT void *SAL_CALL wpftcalc_component_getFactory( - char const *pImplName, void *pServiceManager, void *pRegistryKey) -{ - return cppu::component_getFactoryHelper( - pImplName, pServiceManager, pRegistryKey, services); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |