diff options
author | Noel Grandin <noel@peralex.com> | 2020-07-26 20:14:08 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-07-27 08:30:40 +0200 |
commit | 545dcd2c743ed40b9adaa2f60692200589b60eb7 (patch) | |
tree | b7dc1ce08b17294fa7c6b16ada13c282f2cc46d8 /extensions/source/config | |
parent | a67f89078ec50239bf9dafbde67feab7e6ff035a (diff) |
extensions/WinUserInfo: create instances with uno constructors
See tdf#74608 for motivation.
Change-Id: I16e7da267af4d6e45522b502515cebe52352b2f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99460
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'extensions/source/config')
4 files changed, 12 insertions, 58 deletions
diff --git a/extensions/source/config/WinUserInfo/WinUserInfoBe.component b/extensions/source/config/WinUserInfo/WinUserInfoBe.component index 90c3e0060685..5dd7d21ad748 100644 --- a/extensions/source/config/WinUserInfo/WinUserInfoBe.component +++ b/extensions/source/config/WinUserInfo/WinUserInfoBe.component @@ -8,8 +8,9 @@ --> <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" - prefix="WinUserInfoBe" xmlns="http://openoffice.org/2010/uno-components"> - <implementation name="com.sun.star.comp.configuration.backend.WinUserInfoBe"> + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.configuration.backend.WinUserInfoBe" + constructor="extensions_WinUserInfoBe_get_implementation"> <service name="com.sun.star.configuration.backend.WinUserInfoBe"/> </implementation> </component> diff --git a/extensions/source/config/WinUserInfo/WinUserInfoBe.cxx b/extensions/source/config/WinUserInfo/WinUserInfoBe.cxx index f9ebaca1edd7..83223d932bb7 100644 --- a/extensions/source/config/WinUserInfo/WinUserInfoBe.cxx +++ b/extensions/source/config/WinUserInfo/WinUserInfoBe.cxx @@ -448,19 +448,11 @@ css::uno::Any WinUserInfoBe::getPropertyValue(OUString const& PropertyName) !sValue.isEmpty(), sValue.isEmpty() ? css::uno::Any() : css::uno::makeAny(sValue))); } -OUString WinUserInfoBe::getWinUserInfoBeName() +OUString SAL_CALL WinUserInfoBe::getImplementationName() { return "com.sun.star.comp.configuration.backend.WinUserInfoBe"; } -OUString SAL_CALL WinUserInfoBe::getImplementationName() { return getWinUserInfoBeName(); } - -css::uno::Sequence<OUString> WinUserInfoBe::getWinUserInfoBeServiceNames() -{ - css::uno::Sequence<OUString> aServices{ "com.sun.star.configuration.backend.WinUserInfoBe" }; - return aServices; -} - sal_Bool SAL_CALL WinUserInfoBe::supportsService(const OUString& aServiceName) { return cppu::supportsService(this, aServiceName); @@ -468,10 +460,17 @@ sal_Bool SAL_CALL WinUserInfoBe::supportsService(const OUString& aServiceName) css::uno::Sequence<OUString> SAL_CALL WinUserInfoBe::getSupportedServiceNames() { - return getWinUserInfoBeServiceNames(); + return { "com.sun.star.configuration.backend.WinUserInfoBe" }; } } } } +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* +extensions_WinUserInfoBe_get_implementation(css::uno::XComponentContext* context, + css::uno::Sequence<css::uno::Any> const&) +{ + return cppu::acquire(new extensions::config::WinUserInfo::WinUserInfoBe(context)); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/source/config/WinUserInfo/WinUserInfoBe.hxx b/extensions/source/config/WinUserInfo/WinUserInfoBe.hxx index 766b88c41227..4ebca2678a59 100644 --- a/extensions/source/config/WinUserInfo/WinUserInfoBe.hxx +++ b/extensions/source/config/WinUserInfo/WinUserInfoBe.hxx @@ -92,17 +92,6 @@ public: { } - /** - Provides the implementation name. - @return implementation name - */ - static OUString getWinUserInfoBeName(); - /** - Provides the supported services names - @return service names - */ - static css::uno::Sequence<OUString> getWinUserInfoBeServiceNames(); - private: std::unique_ptr<WinUserInfoBe_Impl> m_pImpl; }; diff --git a/extensions/source/config/WinUserInfo/componentdef.cxx b/extensions/source/config/WinUserInfo/componentdef.cxx deleted file mode 100644 index e2d38e98866f..000000000000 --- a/extensions/source/config/WinUserInfo/componentdef.cxx +++ /dev/null @@ -1,35 +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/. - */ - -#include "WinUserInfoBe.hxx" -#include <cppuhelper/implementationentry.hxx> - -using namespace extensions::config::WinUserInfo; - -static css::uno::Reference<css::uno::XInterface> -createWinUserInfoBe(const css::uno::Reference<css::uno::XComponentContext>& aContext) -{ - return *new WinUserInfoBe(aContext); -} - -static const cppu::ImplementationEntry kImplementations_entries[] - = { { createWinUserInfoBe, WinUserInfoBe::getWinUserInfoBeName, - WinUserInfoBe::getWinUserInfoBeServiceNames, cppu::createSingleComponentFactory, nullptr, - 0 }, - { nullptr, nullptr, nullptr, nullptr, nullptr, 0 } }; - -extern "C" SAL_DLLPUBLIC_EXPORT void* -WinUserInfoBe_component_getFactory(const char* aImplementationName, void* aServiceManager, - void* aRegistryKey) -{ - return cppu::component_getFactoryHelper(aImplementationName, aServiceManager, aRegistryKey, - kImplementations_entries); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |