extensions/Library_ldapbe2.mk                       |    1 
 extensions/source/config/ldap/componentdef.cxx      |   57 --------------------
 extensions/source/config/ldap/ldapbe2.component     |    5 +
 extensions/source/config/ldap/ldapuserprofilebe.cxx |   23 +++-----
 extensions/source/config/ldap/ldapuserprofilebe.hxx |   12 ----
 5 files changed, 12 insertions(+), 86 deletions(-)

New commits:
commit 1bd28e209f2c3ad5fa9c60e365289db70219831e
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Jul 23 10:06:15 2020 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Jul 23 12:07:01 2020 +0200

    extensions/ldap: create instances with uno constructors
    
    See tdf#74608 for motivation.
    
    Change-Id: I159eb26fd69151065080d3f70a6fc9df0104068f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99273
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/extensions/Library_ldapbe2.mk b/extensions/Library_ldapbe2.mk
index e76dcc21a5dd..6d81426ad53e 100644
--- a/extensions/Library_ldapbe2.mk
+++ b/extensions/Library_ldapbe2.mk
@@ -22,7 +22,6 @@ $(eval $(call gb_Library_add_defs,ldapbe2,\
 endif
 
 $(eval $(call gb_Library_add_exception_objects,ldapbe2,\
-       extensions/source/config/ldap/componentdef \
        extensions/source/config/ldap/ldapaccess \
        extensions/source/config/ldap/ldapuserprofilebe \
 ))
diff --git a/extensions/source/config/ldap/componentdef.cxx 
b/extensions/source/config/ldap/componentdef.cxx
deleted file mode 100644
index 4767e09727bb..000000000000
--- a/extensions/source/config/ldap/componentdef.cxx
+++ /dev/null
@@ -1,57 +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 "ldapuserprofilebe.hxx"
-#include <cppuhelper/implementationentry.hxx>
-
-using namespace extensions::config::ldap ;
-
-
-static uno::Reference<uno::XInterface> createLdapUserProfileBe(
-                   const uno::Reference<uno::XComponentContext>& aContext) {
-    return * new LdapUserProfileBe(aContext) ;
-}
-
-
-const cppu::ImplementationEntry kImplementations_entries[] =
-{
-    {
-        createLdapUserProfileBe,
-        LdapUserProfileBe::getLdapUserProfileBeName,
-        LdapUserProfileBe::getLdapUserProfileBeServiceNames,
-        cppu::createSingleComponentFactory,
-        nullptr,
-        0
-    },
-    { nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
-} ;
-
-
-extern "C" SAL_DLLPUBLIC_EXPORT void * ldapbe2_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: */
diff --git a/extensions/source/config/ldap/ldapbe2.component 
b/extensions/source/config/ldap/ldapbe2.component
index 7e07ba415f56..8f6ea3f80639 100644
--- a/extensions/source/config/ldap/ldapbe2.component
+++ b/extensions/source/config/ldap/ldapbe2.component
@@ -18,8 +18,9 @@
  -->
 
 <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
-    prefix="ldapbe2" xmlns="http://openoffice.org/2010/uno-components";>
-  <implementation 
name="com.sun.star.comp.configuration.backend.LdapUserProfileBe">
+    xmlns="http://openoffice.org/2010/uno-components";>
+  <implementation 
name="com.sun.star.comp.configuration.backend.LdapUserProfileBe"
+    constructor="extensions_ldp_LdapUserProfileBe_get_implementation">
     <service name="com.sun.star.configuration.backend.LdapUserProfileBe"/>
   </implementation>
 </component>
diff --git a/extensions/source/config/ldap/ldapuserprofilebe.cxx 
b/extensions/source/config/ldap/ldapuserprofilebe.cxx
index fdb6ccba9b77..8be633a4ca3e 100644
--- a/extensions/source/config/ldap/ldapuserprofilebe.cxx
+++ b/extensions/source/config/ldap/ldapuserprofilebe.cxx
@@ -187,21 +187,9 @@ css::uno::Any LdapUserProfileBe::getPropertyValue(
 }
 
 
-OUString LdapUserProfileBe::getLdapUserProfileBeName() {
-    return "com.sun.star.comp.configuration.backend.LdapUserProfileBe";
-}
-
-
 OUString SAL_CALL LdapUserProfileBe::getImplementationName()
 {
-    return getLdapUserProfileBeName() ;
-}
-
-
-uno::Sequence<OUString> LdapUserProfileBe::getLdapUserProfileBeServiceNames()
-{
-    uno::Sequence<OUString> aServices { 
"com.sun.star.configuration.backend.LdapUserProfileBe" };
-    return aServices ;
+    return "com.sun.star.comp.configuration.backend.LdapUserProfileBe";
 }
 
 sal_Bool SAL_CALL LdapUserProfileBe::supportsService(const OUString& 
aServiceName)
@@ -212,10 +200,17 @@ sal_Bool SAL_CALL 
LdapUserProfileBe::supportsService(const OUString& aServiceNam
 uno::Sequence<OUString>
 SAL_CALL LdapUserProfileBe::getSupportedServiceNames()
 {
-    return getLdapUserProfileBeServiceNames() ;
+    return { "com.sun.star.configuration.backend.LdapUserProfileBe" };
 }
 
 }
 
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+extensions_ldp_LdapUserProfileBe_get_implementation(
+    css::uno::XComponentContext* context , css::uno::Sequence<css::uno::Any> 
const&)
+{
+    return cppu::acquire(new 
extensions::config::ldap::LdapUserProfileBe(context));
+}
+
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/source/config/ldap/ldapuserprofilebe.hxx 
b/extensions/source/config/ldap/ldapuserprofilebe.hxx
index aaefcd8344e6..634d0e848992 100644
--- a/extensions/source/config/ldap/ldapuserprofilebe.hxx
+++ b/extensions/source/config/ldap/ldapuserprofilebe.hxx
@@ -96,18 +96,6 @@ class LdapUserProfileBe : private LdapProfileMutexHolder, 
public BackendBase
             css::uno::Reference< css::beans::XVetoableChangeListener > const 
&) override
         {}
 
-         /**
-          Provides the implementation name.
-          @return   implementation name
-          */
-        static OUString getLdapUserProfileBeName() ;
-        /**
-          Provides the supported services names
-          @return   service names
-          */
-        static uno::Sequence<OUString>
-            getLdapUserProfileBeServiceNames() ;
-
     private:
         /** Check if LDAP is configured */
         static bool readLdapConfiguration(
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to