diff options
author | David Tardon <dtardon@redhat.com> | 2016-02-08 08:15:27 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2016-02-08 09:37:13 +0100 |
commit | eff6d8213665c7b955fddadc1f446c76b0074924 (patch) | |
tree | ac52d21b6e7e95f5d9289e0079c1a53393daf8b6 /writerperfect | |
parent | 3af1b7f59340e5b82e65680d157d0ea16cdc3c81 (diff) |
wpftimpress: use service constructor
Change-Id: Ic53703b68b816eafe598f70df46aaa11b452b4f7
Diffstat (limited to 'writerperfect')
6 files changed, 35 insertions, 124 deletions
diff --git a/writerperfect/Library_wpftimpress.mk b/writerperfect/Library_wpftimpress.mk index 3d35aa778151..116b72a1235a 100644 --- a/writerperfect/Library_wpftimpress.mk +++ b/writerperfect/Library_wpftimpress.mk @@ -57,7 +57,6 @@ $(eval $(call gb_Library_use_externals,wpftimpress,\ $(eval $(call gb_Library_add_exception_objects,wpftimpress,\ writerperfect/source/impress/KeynoteImportFilter \ writerperfect/source/impress/MWAWPresentationImportFilter \ - writerperfect/source/impress/wpftimpress_genericfilter \ )) # vim: set noet sw=4 ts=4: diff --git a/writerperfect/source/impress/KeynoteImportFilter.cxx b/writerperfect/source/impress/KeynoteImportFilter.cxx index 312f7a4d66bf..c54091cd1bfb 100644 --- a/writerperfect/source/impress/KeynoteImportFilter.cxx +++ b/writerperfect/source/impress/KeynoteImportFilter.cxx @@ -238,33 +238,11 @@ throw(css::uno::RuntimeException, std::exception) return sTypeName; } -OUString KeynoteImportFilter_getImplementationName() -throw (RuntimeException) -{ - return OUString("org.libreoffice.comp.Impress.KeynoteImportFilter"); -} - -Sequence< OUString > SAL_CALL KeynoteImportFilter_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 KeynoteImportFilter_createInstance(const Reference< XComponentContext > &rContext) -throw(Exception) -{ - return static_cast<cppu::OWeakObject *>(new KeynoteImportFilter(rContext)); -} - // XServiceInfo OUString SAL_CALL KeynoteImportFilter::getImplementationName() throw (RuntimeException, std::exception) { - return KeynoteImportFilter_getImplementationName(); + return OUString("org.libreoffice.comp.Impress.KeynoteImportFilter"); } sal_Bool SAL_CALL KeynoteImportFilter::supportsService(const OUString &rServiceName) @@ -276,7 +254,20 @@ throw (RuntimeException, std::exception) Sequence< OUString > SAL_CALL KeynoteImportFilter::getSupportedServiceNames() throw (RuntimeException, std::exception) { - return KeynoteImportFilter_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_Impress_KeynoteImportFilter_get_implementation( + css::uno::XComponentContext *const context, + const css::uno::Sequence<css::uno::Any> &) +{ + return cppu::acquire(new KeynoteImportFilter(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerperfect/source/impress/KeynoteImportFilter.hxx b/writerperfect/source/impress/KeynoteImportFilter.hxx index 69daf682d2a4..e4c88001c006 100644 --- a/writerperfect/source/impress/KeynoteImportFilter.hxx +++ b/writerperfect/source/impress/KeynoteImportFilter.hxx @@ -41,19 +41,6 @@ private: virtual bool doImportDocument(librevenge::RVNGInputStream &rInput, OdpGenerator &rGenerator, utl::MediaDescriptor &) override; }; -OUString KeynoteImportFilter_getImplementationName() -throw (css::uno::RuntimeException); - -bool SAL_CALL KeynoteImportFilter_supportsService(const OUString &ServiceName) -throw (css::uno::RuntimeException); - -css::uno::Sequence< OUString > SAL_CALL KeynoteImportFilter_getSupportedServiceNames() -throw (css::uno::RuntimeException); - -css::uno::Reference< css::uno::XInterface > -SAL_CALL KeynoteImportFilter_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/impress/MWAWPresentationImportFilter.cxx b/writerperfect/source/impress/MWAWPresentationImportFilter.cxx index 68c9b3bde6bb..5027df4b7144 100644 --- a/writerperfect/source/impress/MWAWPresentationImportFilter.cxx +++ b/writerperfect/source/impress/MWAWPresentationImportFilter.cxx @@ -78,33 +78,11 @@ void MWAWPresentationImportFilter::doRegisterHandlers(OdpGenerator &rGenerator) rGenerator.registerEmbeddedObjectHandler("image/mwaw-ods", &handleEmbeddedMWAWSpreadsheetObject); } -OUString MWAWPresentationImportFilter_getImplementationName() -throw (RuntimeException) -{ - return OUString("com.sun.star.comp.Impress.MWAWPresentationImportFilter"); -} - -Sequence< OUString > SAL_CALL MWAWPresentationImportFilter_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 MWAWPresentationImportFilter_createInstance(const Reference< XComponentContext > &rContext) -throw(Exception) -{ - return static_cast<cppu::OWeakObject *>(new MWAWPresentationImportFilter(rContext)); -} - // XServiceInfo OUString SAL_CALL MWAWPresentationImportFilter::getImplementationName() throw (RuntimeException, std::exception) { - return MWAWPresentationImportFilter_getImplementationName(); + return OUString("com.sun.star.comp.Impress.MWAWPresentationImportFilter"); } sal_Bool SAL_CALL MWAWPresentationImportFilter::supportsService(const OUString &rServiceName) throw (RuntimeException, std::exception) @@ -114,7 +92,20 @@ throw (RuntimeException, std::exception) Sequence< OUString > SAL_CALL MWAWPresentationImportFilter::getSupportedServiceNames() throw (RuntimeException, std::exception) { - return MWAWPresentationImportFilter_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_Impress_MWAWPresentationImportFilter_get_implementation( + css::uno::XComponentContext *const context, + const css::uno::Sequence<css::uno::Any> &) +{ + return cppu::acquire(new MWAWPresentationImportFilter(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerperfect/source/impress/wpftimpress.component b/writerperfect/source/impress/wpftimpress.component index 58d00cc279b0..5413c9a7b4bd 100644 --- a/writerperfect/source/impress/wpftimpress.component +++ b/writerperfect/source/impress/wpftimpress.component @@ -8,12 +8,14 @@ * --> <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" - prefix="wpftimpress" xmlns="http://openoffice.org/2010/uno-components"> - <implementation name="org.libreoffice.comp.Impress.KeynoteImportFilter"> + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="org.libreoffice.comp.Impress.KeynoteImportFilter" + constructor="org_libreoffice_comp_Impress_KeynoteImportFilter_get_implementation"> <service name="com.sun.star.document.ImportFilter"/> <service name="com.sun.star.document.ExtendedTypeDetection"/> </implementation> - <implementation name="com.sun.star.comp.Impress.MWAWPresentationImportFilter"> + <implementation name="com.sun.star.comp.Impress.MWAWPresentationImportFilter" + constructor="com_sun_star_comp_Impress_MWAWPresentationImportFilter_get_implementation"> <service name="com.sun.star.document.ImportFilter"/> <service name="com.sun.star.document.ExtendedTypeDetection"/> </implementation> diff --git a/writerperfect/source/impress/wpftimpress_genericfilter.cxx b/writerperfect/source/impress/wpftimpress_genericfilter.cxx deleted file mode 100644 index 2f50025fefed..000000000000 --- a/writerperfect/source/impress/wpftimpress_genericfilter.cxx +++ /dev/null @@ -1,59 +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 */ - -#include "sal/config.h" - -#include "cppuhelper/factory.hxx" -#include "cppuhelper/implementationentry.hxx" -#include "sal/types.h" - -#include "KeynoteImportFilter.hxx" -#include "MWAWPresentationImportFilter.hxx" - -namespace -{ - -static cppu::ImplementationEntry const services[] = -{ - { - &KeynoteImportFilter_createInstance, &KeynoteImportFilter_getImplementationName, - &KeynoteImportFilter_getSupportedServiceNames, - &cppu::createSingleComponentFactory, nullptr, 0 - }, - { - &MWAWPresentationImportFilter_createInstance, - &MWAWPresentationImportFilter_getImplementationName, - &MWAWPresentationImportFilter_getSupportedServiceNames, - &cppu::createSingleComponentFactory, nullptr, 0 - }, - { nullptr, nullptr, nullptr, nullptr, nullptr, 0 } -}; - -} - -extern "C" SAL_DLLPUBLIC_EXPORT void *SAL_CALL wpftimpress_component_getFactory( - char const *pImplName, void *pServiceManager, void *pRegistryKey) -{ - return cppu::component_getFactoryHelper( - pImplName, pServiceManager, pRegistryKey, services); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |