[Libreoffice-commits] core.git: extensions/Library_WinUserInfoBe.mk extensions/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Mon Jul 27 06:31:19 UTC 2020


 extensions/Library_WinUserInfoBe.mk                          |    1 
 extensions/source/config/WinUserInfo/WinUserInfoBe.component |    5 -
 extensions/source/config/WinUserInfo/WinUserInfoBe.cxx       |   19 ++---
 extensions/source/config/WinUserInfo/WinUserInfoBe.hxx       |   11 ---
 extensions/source/config/WinUserInfo/componentdef.cxx        |   35 -----------
 5 files changed, 12 insertions(+), 59 deletions(-)

New commits:
commit 545dcd2c743ed40b9adaa2f60692200589b60eb7
Author:     Noel Grandin <noel at peralex.com>
AuthorDate: Sun Jul 26 20:14:08 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Jul 27 08:30:40 2020 +0200

    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 at collabora.co.uk>

diff --git a/extensions/Library_WinUserInfoBe.mk b/extensions/Library_WinUserInfoBe.mk
index 8d9835db5000..34a635851a82 100644
--- a/extensions/Library_WinUserInfoBe.mk
+++ b/extensions/Library_WinUserInfoBe.mk
@@ -16,7 +16,6 @@ $(eval $(call gb_Library_set_componentfile,WinUserInfoBe,extensions/source/confi
 $(eval $(call gb_Library_use_sdk_api,WinUserInfoBe))
 
 $(eval $(call gb_Library_add_exception_objects,WinUserInfoBe,\
-	extensions/source/config/WinUserInfo/componentdef \
 	extensions/source/config/WinUserInfo/WinUserInfoBe \
 ))
 
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: */


More information about the Libreoffice-commits mailing list