diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2020-07-05 13:22:12 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-07-06 08:43:12 +0200 |
commit | 37b2c02bee606ee2238dc6b0c85f9d5da78a02ba (patch) | |
tree | 33fd17cee09b688231ab6025fa2be857193ce846 /configmgr | |
parent | 508a596df1a75e27b199bfebb08ee66583e35d99 (diff) |
configmgr: create instances with uno constructors
See tdf#74608 for motivation
Change-Id: I8d1419a9f2c0eb4d488b3f60b357f12e8177d7b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98134
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'configmgr')
-rw-r--r-- | configmgr/Library_configmgr.mk | 1 | ||||
-rw-r--r-- | configmgr/source/configmgr.component | 20 | ||||
-rw-r--r-- | configmgr/source/configurationprovider.cxx | 75 | ||||
-rw-r--r-- | configmgr/source/configurationprovider.hxx | 12 | ||||
-rw-r--r-- | configmgr/source/configurationregistry.cxx | 21 | ||||
-rw-r--r-- | configmgr/source/configurationregistry.hxx | 51 | ||||
-rw-r--r-- | configmgr/source/defaultprovider.cxx | 16 | ||||
-rw-r--r-- | configmgr/source/defaultprovider.hxx | 12 | ||||
-rw-r--r-- | configmgr/source/readonlyaccess.cxx | 23 | ||||
-rw-r--r-- | configmgr/source/readonlyaccess.hxx | 39 | ||||
-rw-r--r-- | configmgr/source/readwriteaccess.cxx | 22 | ||||
-rw-r--r-- | configmgr/source/readwriteaccess.hxx | 39 | ||||
-rw-r--r-- | configmgr/source/services.cxx | 82 | ||||
-rw-r--r-- | configmgr/source/update.cxx | 19 | ||||
-rw-r--r-- | configmgr/source/update.hxx | 51 |
15 files changed, 56 insertions, 427 deletions
diff --git a/configmgr/Library_configmgr.mk b/configmgr/Library_configmgr.mk index 19477b172308..e09abc6ad6c1 100644 --- a/configmgr/Library_configmgr.mk +++ b/configmgr/Library_configmgr.mk @@ -33,7 +33,6 @@ $(eval $(call gb_Library_add_exception_objects,configmgr, \ configmgr/source/readwriteaccess \ configmgr/source/rootaccess \ configmgr/source/rootnode \ - configmgr/source/services \ configmgr/source/setnode \ configmgr/source/type \ configmgr/source/update \ diff --git a/configmgr/source/configmgr.component b/configmgr/source/configmgr.component index 24fd608c33fd..c8b0c4f01260 100644 --- a/configmgr/source/configmgr.component +++ b/configmgr/source/configmgr.component @@ -18,24 +18,30 @@ --> <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" - prefix="configmgr" xmlns="http://openoffice.org/2010/uno-components"> - <implementation name="com.sun.star.comp.configuration.ConfigurationProvider"> + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.configuration.ConfigurationProvider" + constructor="com_sun_star_comp_configuration_ConfigurationProvider_get_implementation"> <service name="com.sun.star.configuration.ConfigurationProvider"/> </implementation> - <implementation name="com.sun.star.comp.configuration.ConfigurationRegistry"> + <implementation name="com.sun.star.comp.configuration.ConfigurationRegistry" + constructor="com_sun_star_comp_configuration_ConfigurationRegistry_get_implementation"> <service name="com.sun.star.configuration.ConfigurationRegistry"/> </implementation> - <implementation name="com.sun.star.comp.configuration.DefaultProvider"> + <implementation name="com.sun.star.comp.configuration.DefaultProvider" + constructor="com_sun_star_comp_configuration_DefaultProvider_get_implementation"> <service name="com.sun.star.configuration.DefaultProvider"/> <singleton name="com.sun.star.configuration.theDefaultProvider"/> </implementation> - <implementation name="com.sun.star.comp.configuration.ReadOnlyAccess"> + <implementation name="com.sun.star.comp.configuration.ReadOnlyAccess" + constructor="com_sun_star_comp_configuration_ReadOnlyAccess_get_implementation"> <service name="com.sun.star.configuration.ReadOnlyAccess"/> </implementation> - <implementation name="com.sun.star.comp.configuration.ReadWriteAccess"> + <implementation name="com.sun.star.comp.configuration.ReadWriteAccess" + constructor="com_sun_star_comp_configuration_ReadWriteAccess_get_implementation"> <service name="com.sun.star.configuration.ReadWriteAccess"/> </implementation> - <implementation name="com.sun.star.comp.configuration.Update"> + <implementation name="com.sun.star.comp.configuration.Update" + constructor="com_sun_star_comp_configuration_Update_get_implementation"> <service name="com.sun.star.configuration.Update_Service"/> <singleton name="com.sun.star.configuration.Update"/> </implementation> diff --git a/configmgr/source/configurationprovider.cxx b/configmgr/source/configurationprovider.cxx index 467d73bfdc23..2d9e1189dec0 100644 --- a/configmgr/source/configurationprovider.cxx +++ b/configmgr/source/configurationprovider.cxx @@ -116,7 +116,7 @@ private: { return default_ ? default_provider::getImplementationName() - : configuration_provider::getImplementationName(); + : "com.sun.star.comp.configuration.ConfigurationProvider"; } virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override @@ -127,7 +127,7 @@ private: { return default_ ? default_provider::getSupportedServiceNames() - : configuration_provider::getSupportedServiceNames(); + : css::uno::Sequence<OUString> { "com.sun.star.configuration.ConfigurationProvider" }; } virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( @@ -342,53 +342,14 @@ void Service::flushModifications() const { components->flushModifications(); } -class Factory: - public cppu::WeakImplHelper< - css::lang::XSingleComponentFactory, css::lang::XServiceInfo > -{ -public: - Factory() {} - -private: - Factory(const Factory&) = delete; - Factory& operator=(const Factory&) = delete; - - virtual ~Factory() override {} - - virtual css::uno::Reference< css::uno::XInterface > SAL_CALL - createInstanceWithContext( - css::uno::Reference< css::uno::XComponentContext > const & Context) override; - - virtual css::uno::Reference< css::uno::XInterface > SAL_CALL - createInstanceWithArgumentsAndContext( - css::uno::Sequence< css::uno::Any > const & Arguments, - css::uno::Reference< css::uno::XComponentContext > const & Context) override; - - virtual OUString SAL_CALL getImplementationName() override - { return configuration_provider::getImplementationName(); } - - virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override - { return cppu::supportsService(this, ServiceName); } - - virtual css::uno::Sequence< OUString > SAL_CALL - getSupportedServiceNames() override - { return configuration_provider::getSupportedServiceNames(); } -}; - -css::uno::Reference< css::uno::XInterface > Factory::createInstanceWithContext( - css::uno::Reference< css::uno::XComponentContext > const & Context) -{ - return createInstanceWithArgumentsAndContext( - css::uno::Sequence< css::uno::Any >(), Context); -} - -css::uno::Reference< css::uno::XInterface > -Factory::createInstanceWithArgumentsAndContext( - css::uno::Sequence< css::uno::Any > const & Arguments, - css::uno::Reference< css::uno::XComponentContext > const & Context) +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* +com_sun_star_comp_configuration_ConfigurationProvider_get_implementation( + css::uno::XComponentContext* Context, css::uno::Sequence<css::uno::Any> const& Arguments) { if (!Arguments.hasElements()) { - return css::configuration::theDefaultProvider::get(Context); + auto p = css::configuration::theDefaultProvider::get(Context); + p->acquire(); + return p.get(); } else { OUString locale; for (sal_Int32 i = 0; i < Arguments.getLength(); ++i) { @@ -427,7 +388,7 @@ Factory::createInstanceWithArgumentsAndContext( nullptr); } } - return static_cast< cppu::OWeakObject * >(new Service(Context, locale)); + return cppu::acquire(static_cast< cppu::OWeakObject * >(new Service(Context, locale))); } } @@ -439,24 +400,6 @@ css::uno::Reference< css::uno::XInterface > createDefault( return static_cast< cppu::OWeakObject * >(new Service(context)); } -OUString getImplementationName() { - return "com.sun.star.comp.configuration.ConfigurationProvider"; -} - -css::uno::Sequence< OUString > getSupportedServiceNames() { - return css::uno::Sequence< OUString > { "com.sun.star.configuration.ConfigurationProvider" }; -} - -css::uno::Reference< css::lang::XSingleComponentFactory > -createFactory( - SAL_UNUSED_PARAMETER cppu::ComponentFactoryFunc, - SAL_UNUSED_PARAMETER OUString const &, - SAL_UNUSED_PARAMETER css::uno::Sequence< OUString > const &, - SAL_UNUSED_PARAMETER rtl_ModuleCount *) -{ - return new Factory; -} - } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/configurationprovider.hxx b/configmgr/source/configurationprovider.hxx index 6f9696127374..ffd7f6133185 100644 --- a/configmgr/source/configurationprovider.hxx +++ b/configmgr/source/configurationprovider.hxx @@ -24,10 +24,8 @@ #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/uno/Sequence.hxx> -#include <cppuhelper/factory.hxx> namespace com::sun::star { - namespace lang { class XSingleComponentFactory; } namespace uno { class XComponentContext; class XInterface; @@ -40,16 +38,6 @@ css::uno::Reference< css::uno::XInterface > createDefault( css::uno::Reference< css::uno::XComponentContext > const & context); -OUString getImplementationName(); - -css::uno::Sequence< OUString > -getSupportedServiceNames(); - -css::uno::Reference< css::lang::XSingleComponentFactory > -createFactory( - cppu::ComponentFactoryFunc, OUString const &, - css::uno::Sequence< OUString > const &, rtl_ModuleCount *); - } #endif diff --git a/configmgr/source/configurationregistry.cxx b/configmgr/source/configurationregistry.cxx index 5e57e8bf387d..3e809f3054ef 100644 --- a/configmgr/source/configurationregistry.cxx +++ b/configmgr/source/configurationregistry.cxx @@ -54,8 +54,6 @@ #include <rtl/ustring.hxx> #include <sal/types.h> -#include "configurationregistry.hxx" - namespace com::sun::star::util { class XFlushListener; } @@ -79,14 +77,14 @@ private: virtual ~Service() override {} virtual OUString SAL_CALL getImplementationName() override - { return configuration_registry::getImplementationName(); } + { return "com.sun.star.comp.configuration.ConfigurationRegistry"; } virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override { return cppu::supportsService(this, ServiceName); } virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override - { return configuration_registry::getSupportedServiceNames(); } + { return { "com.sun.star.configuration.ConfigurationRegistry" }; } virtual OUString SAL_CALL getURL() override; @@ -630,18 +628,11 @@ OUString RegistryKey::getResolvedName(OUString const & aKeyName) } -css::uno::Reference< css::uno::XInterface > create( - css::uno::Reference< css::uno::XComponentContext > const & context) +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* +com_sun_star_comp_configuration_ConfigurationRegistry_get_implementation( + css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&) { - return static_cast< cppu::OWeakObject * >(new Service(context)); -} - -OUString getImplementationName() { - return "com.sun.star.comp.configuration.ConfigurationRegistry"; -} - -css::uno::Sequence< OUString > getSupportedServiceNames() { - return css::uno::Sequence< OUString > { "com.sun.star.configuration.ConfigurationRegistry" }; + return cppu::acquire(static_cast< cppu::OWeakObject * >(new Service(context))); } } diff --git a/configmgr/source/configurationregistry.hxx b/configmgr/source/configurationregistry.hxx deleted file mode 100644 index 5f74880590aa..000000000000 --- a/configmgr/source/configurationregistry.hxx +++ /dev/null @@ -1,51 +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 . - */ - -#ifndef INCLUDED_CONFIGMGR_SOURCE_CONFIGURATIONREGISTRY_HXX -#define INCLUDED_CONFIGMGR_SOURCE_CONFIGURATIONREGISTRY_HXX - -#include <sal/config.h> - -#include <com/sun/star/uno/Reference.hxx> -#include <com/sun/star/uno/Sequence.hxx> - -namespace com::sun::star { - namespace uno { - class XComponentContext; - class XInterface; - } -} - -namespace configmgr::configuration_registry { - -css::uno::Reference< css::uno::XInterface > -create( - css::uno::Reference< css::uno::XComponentContext > - const & context); - -OUString getImplementationName(); - -css::uno::Sequence< OUString > -getSupportedServiceNames(); - -} - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/defaultprovider.cxx b/configmgr/source/defaultprovider.cxx index d07dcd382d80..4cc7a24d0c93 100644 --- a/configmgr/source/defaultprovider.cxx +++ b/configmgr/source/defaultprovider.cxx @@ -29,17 +29,19 @@ #include "defaultprovider.hxx" #include "lock.hxx" -namespace configmgr::default_provider { - -css::uno::Reference< css::uno::XInterface > create( - css::uno::Reference< css::uno::XComponentContext > const & context) +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* +com_sun_star_comp_configuration_DefaultProvider_get_implementation( + css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&) { - osl::MutexGuard guard(*lock()); + osl::MutexGuard guard(*configmgr::lock()); static css::uno::Reference< css::uno::XInterface > singleton( - configuration_provider::createDefault(context)); - return singleton; + configmgr::configuration_provider::createDefault(context)); + singleton->acquire(); + return singleton.get(); } +namespace configmgr::default_provider { + OUString getImplementationName() { return "com.sun.star.comp.configuration.DefaultProvider"; } diff --git a/configmgr/source/defaultprovider.hxx b/configmgr/source/defaultprovider.hxx index da97bc8baa55..2a1e1d1ae332 100644 --- a/configmgr/source/defaultprovider.hxx +++ b/configmgr/source/defaultprovider.hxx @@ -25,20 +25,8 @@ #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/uno/Sequence.hxx> -namespace com::sun::star { - namespace uno { - class XComponentContext; - class XInterface; - } -} - namespace configmgr::default_provider { -css::uno::Reference< css::uno::XInterface > -create( - css::uno::Reference< css::uno::XComponentContext > - const & context); - OUString getImplementationName(); css::uno::Sequence< OUString > diff --git a/configmgr/source/readonlyaccess.cxx b/configmgr/source/readonlyaccess.cxx index 5da0f122cc7d..f777395f31fe 100644 --- a/configmgr/source/readonlyaccess.cxx +++ b/configmgr/source/readonlyaccess.cxx @@ -29,7 +29,6 @@ #include "components.hxx" #include "lock.hxx" -#include "readonlyaccess.hxx" #include "rootaccess.hxx" namespace configmgr::read_only_access { @@ -53,14 +52,14 @@ private: virtual ~Service() override {} virtual OUString SAL_CALL getImplementationName() override - { return read_only_access::getImplementationName(); } + { return "com.sun.star.comp.configuration.ReadOnlyAccess"; } virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override { return cppu::supportsService(this, ServiceName); } virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override - { return read_only_access::getSupportedServiceNames(); } + { return { "com.sun.star.configuration.ReadOnlyAccess" }; } virtual void SAL_CALL initialize( css::uno::Sequence< css::uno::Any > const & aArguments) override; @@ -109,21 +108,13 @@ rtl::Reference< RootAccess > Service::getRoot() { } } - -css::uno::Reference< css::uno::XInterface > create( - css::uno::Reference< css::uno::XComponentContext > const & context) -{ - return static_cast< cppu::OWeakObject * >(new Service(context)); -} - -OUString getImplementationName() { - return "com.sun.star.comp.configuration.ReadOnlyAccess"; -} - -css::uno::Sequence< OUString > getSupportedServiceNames() { - return css::uno::Sequence< OUString > { "com.sun.star.configuration.ReadOnlyAccess" }; } +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* +com_sun_star_comp_configuration_ReadOnlyAccess_get_implementation( + css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&) +{ + return cppu::acquire(static_cast< cppu::OWeakObject * >(new configmgr::read_only_access::Service(context))); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/readonlyaccess.hxx b/configmgr/source/readonlyaccess.hxx deleted file mode 100644 index 7d80c986a3f8..000000000000 --- a/configmgr/source/readonlyaccess.hxx +++ /dev/null @@ -1,39 +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/. - */ - -#ifndef INCLUDED_CONFIGMGR_SOURCE_READONLYACCESS_HXX -#define INCLUDED_CONFIGMGR_SOURCE_READONLYACCESS_HXX - -#include <com/sun/star/uno/Reference.hxx> -#include <com/sun/star/uno/Sequence.hxx> - -namespace com::sun::star { - namespace uno { - class XComponentContext; - class XInterface; - } -} - -namespace configmgr::read_only_access { - -css::uno::Reference< css::uno::XInterface > -create( - css::uno::Reference< css::uno::XComponentContext > - const &); - -OUString getImplementationName(); - -css::uno::Sequence< OUString > -getSupportedServiceNames(); - -} - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/readwriteaccess.cxx b/configmgr/source/readwriteaccess.cxx index 376e70182d5f..1eddaaa9347d 100644 --- a/configmgr/source/readwriteaccess.cxx +++ b/configmgr/source/readwriteaccess.cxx @@ -29,7 +29,6 @@ #include "components.hxx" #include "lock.hxx" -#include "readwriteaccess.hxx" #include "rootaccess.hxx" namespace configmgr::read_write_access { @@ -53,14 +52,14 @@ private: virtual ~Service() override {} virtual OUString SAL_CALL getImplementationName() override - { return read_write_access::getImplementationName(); } + { return "com.sun.star.comp.configuration.ReadWriteAccess"; } virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override { return cppu::supportsService(this, ServiceName); } virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override - { return read_write_access::getSupportedServiceNames(); } + { return { "com.sun.star.configuration.ReadWriteAccess" }; } virtual void SAL_CALL initialize( css::uno::Sequence< css::uno::Any > const & aArguments) override; @@ -131,21 +130,14 @@ rtl::Reference< RootAccess > Service::getRoot() { } } - -css::uno::Reference< css::uno::XInterface > create( - css::uno::Reference< css::uno::XComponentContext > const & context) -{ - return static_cast< cppu::OWeakObject * >(new Service(context)); -} - -OUString getImplementationName() { - return "com.sun.star.comp.configuration.ReadWriteAccess"; } -css::uno::Sequence< OUString > getSupportedServiceNames() { - return css::uno::Sequence< OUString > { "com.sun.star.configuration.ReadWriteAccess" }; +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* +com_sun_star_comp_configuration_ReadWriteAccess_get_implementation( + css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const& ) +{ + return cppu::acquire(static_cast< cppu::OWeakObject * >(new configmgr::read_write_access::Service(context))); } -} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/readwriteaccess.hxx b/configmgr/source/readwriteaccess.hxx deleted file mode 100644 index 8e84a8607069..000000000000 --- a/configmgr/source/readwriteaccess.hxx +++ /dev/null @@ -1,39 +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/. - */ - -#ifndef INCLUDED_CONFIGMGR_SOURCE_READWRITEACCESS_HXX -#define INCLUDED_CONFIGMGR_SOURCE_READWRITEACCESS_HXX - -#include <com/sun/star/uno/Reference.hxx> -#include <com/sun/star/uno/Sequence.hxx> - -namespace com::sun::star { - namespace uno { - class XComponentContext; - class XInterface; - } -} - -namespace configmgr::read_write_access { - -css::uno::Reference< css::uno::XInterface > -create( - css::uno::Reference< css::uno::XComponentContext > - const &); - -OUString getImplementationName(); - -css::uno::Sequence< OUString > -getSupportedServiceNames(); - -} - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/services.cxx b/configmgr/source/services.cxx deleted file mode 100644 index ef614b1c5830..000000000000 --- a/configmgr/source/services.cxx +++ /dev/null @@ -1,82 +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 . - */ - -#include <sal/config.h> - -#include <cassert> - -#include <com/sun/star/uno/Reference.hxx> -#include <com/sun/star/uno/XInterface.hpp> -#include <cppuhelper/factory.hxx> -#include <cppuhelper/implementationentry.hxx> -#include <sal/types.h> - -#include "configurationprovider.hxx" -#include "configurationregistry.hxx" -#include "defaultprovider.hxx" -#include "readonlyaccess.hxx" -#include "readwriteaccess.hxx" -#include "update.hxx" - -namespace { - -css::uno::Reference< css::uno::XInterface > dummy( - SAL_UNUSED_PARAMETER css::uno::Reference< css::uno::XComponentContext > - const &) -{ - assert(false); - return css::uno::Reference< css::uno::XInterface >(); -} - -cppu::ImplementationEntry const services[] = { - { &dummy, &configmgr::configuration_provider::getImplementationName, - &configmgr::configuration_provider::getSupportedServiceNames, - &configmgr::configuration_provider::createFactory, nullptr, 0 }, - { &configmgr::default_provider::create, - &configmgr::default_provider::getImplementationName, - &configmgr::default_provider::getSupportedServiceNames, - &cppu::createSingleComponentFactory, nullptr, 0 }, - { &configmgr::configuration_registry::create, - &configmgr::configuration_registry::getImplementationName, - &configmgr::configuration_registry::getSupportedServiceNames, - &cppu::createSingleComponentFactory, nullptr, 0 }, - { &configmgr::read_only_access::create, - &configmgr::read_only_access::getImplementationName, - &configmgr::read_only_access::getSupportedServiceNames, - &cppu::createSingleComponentFactory, nullptr, 0 }, - { &configmgr::read_write_access::create, - &configmgr::read_write_access::getImplementationName, - &configmgr::read_write_access::getSupportedServiceNames, - &cppu::createSingleComponentFactory, nullptr, 0 }, - { &configmgr::update::create, &configmgr::update::getImplementationName, - &configmgr::update::getSupportedServiceNames, - &cppu::createSingleComponentFactory, nullptr, 0 }, - { nullptr, nullptr, nullptr, nullptr, nullptr, 0 } -}; - -} - -extern "C" SAL_DLLPUBLIC_EXPORT void * configmgr_component_getFactory( - char const * pImplName, void * pServiceManager, void * pRegistryKey) -{ - return cppu::component_getFactoryHelper( - pImplName, pServiceManager, pRegistryKey, services); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/update.cxx b/configmgr/source/update.cxx index 69e27f794990..8da48fce43f7 100644 --- a/configmgr/source/update.cxx +++ b/configmgr/source/update.cxx @@ -38,7 +38,6 @@ #include "lock.hxx" #include "modifications.hxx" #include "rootaccess.hxx" -#include "update.hxx" namespace configmgr::update { @@ -139,21 +138,13 @@ void Service::insertModificationXcuFile( } } - -css::uno::Reference< css::uno::XInterface > create( - css::uno::Reference< css::uno::XComponentContext > const & context) -{ - return static_cast< cppu::OWeakObject * >(new Service(context)); -} - -OUString getImplementationName() { - return "com.sun.star.comp.configuration.Update"; -} - -css::uno::Sequence< OUString > getSupportedServiceNames() { - return css::uno::Sequence< OUString > { "com.sun.star.configuration.Update_Service" }; } +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* +com_sun_star_comp_configuration_Update_get_implementation( + css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const& ) +{ + return cppu::acquire(static_cast< cppu::OWeakObject * >(new configmgr::update::Service(context))); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/configmgr/source/update.hxx b/configmgr/source/update.hxx deleted file mode 100644 index 7fd9244d9137..000000000000 --- a/configmgr/source/update.hxx +++ /dev/null @@ -1,51 +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 . - */ - -#ifndef INCLUDED_CONFIGMGR_SOURCE_UPDATE_HXX -#define INCLUDED_CONFIGMGR_SOURCE_UPDATE_HXX - -#include <sal/config.h> - -#include <com/sun/star/uno/Reference.hxx> -#include <com/sun/star/uno/Sequence.hxx> - -namespace com::sun::star { - namespace uno { - class XComponentContext; - class XInterface; - } -} - -namespace configmgr::update { - -css::uno::Reference< css::uno::XInterface > -create( - css::uno::Reference< css::uno::XComponentContext > - const &); - -OUString getImplementationName(); - -css::uno::Sequence< OUString > -getSupportedServiceNames(); - -} - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |