shell/Library_wininetbe.mk                           |    1 
 shell/source/backends/wininetbe/wininetbackend.cxx   |   29 +++-----
 shell/source/backends/wininetbe/wininetbackend.hxx   |   16 ----
 shell/source/backends/wininetbe/wininetbe1.component |    5 -
 shell/source/backends/wininetbe/wininetbecdef.cxx    |   63 -------------------
 5 files changed, 14 insertions(+), 100 deletions(-)

New commits:
commit 7f0fb9a5e7bce720c6fd2d7ddc9fa9dbd353d8a1
Author:     Noel Grandin <n...@peralex.com>
AuthorDate: Tue Jul 21 13:43:37 2020 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Jul 23 08:52:27 2020 +0200

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

diff --git a/shell/Library_wininetbe.mk b/shell/Library_wininetbe.mk
index 080323ea1100..c5dd87df7d4c 100644
--- a/shell/Library_wininetbe.mk
+++ b/shell/Library_wininetbe.mk
@@ -21,7 +21,6 @@ $(eval $(call 
gb_Library_set_componentfile,wininetbe1,shell/source/backends/wini
 
 $(eval $(call gb_Library_add_exception_objects,wininetbe1,\
     shell/source/backends/wininetbe/wininetbackend \
-    shell/source/backends/wininetbe/wininetbecdef \
 ))
 
 # vim: set shiftwidth=4 tabstop=4 noexpandtab:
diff --git a/shell/source/backends/wininetbe/wininetbackend.cxx 
b/shell/source/backends/wininetbe/wininetbackend.cxx
index 0a89b18507d7..8ac38b5517b3 100644
--- a/shell/source/backends/wininetbe/wininetbackend.cxx
+++ b/shell/source/backends/wininetbe/wininetbackend.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <cppuhelper/supportsservice.hxx>
+#include <com/sun/star/uno/XComponentContext.hpp>
 #include <rtl/ustrbuf.hxx>
 #include <sal/log.hxx>
 
@@ -289,11 +290,6 @@ WinInetBackend::~WinInetBackend()
 {
 }
 
-WinInetBackend* WinInetBackend::createInstance()
-{
-    return new WinInetBackend;
-}
-
 void WinInetBackend::setPropertyValue(
     OUString const &, css::uno::Any const &)
 {
@@ -335,20 +331,9 @@ css::uno::Any WinInetBackend::getPropertyValue(
     }
 }
 
-OUString WinInetBackend::getBackendName() {
-    return "com.sun.star.comp.configuration.backend.WinInetBackend" ;
-}
-
 OUString SAL_CALL WinInetBackend::getImplementationName()
 {
-    return getBackendName() ;
-}
-
-uno::Sequence<OUString> WinInetBackend::getBackendServiceNames()
-{
-    uno::Sequence<OUString> aServiceNameList { 
"com.sun.star.configuration.backend.WinInetBackend" };
-
-    return aServiceNameList ;
+    return "com.sun.star.comp.configuration.backend.WinInetBackend" ;
 }
 
 sal_Bool SAL_CALL WinInetBackend::supportsService(const OUString& aServiceName)
@@ -358,7 +343,15 @@ sal_Bool SAL_CALL WinInetBackend::supportsService(const 
OUString& aServiceName)
 
 uno::Sequence<OUString> SAL_CALL WinInetBackend::getSupportedServiceNames()
 {
-    return getBackendServiceNames() ;
+    return { "com.sun.star.configuration.backend.WinInetBackend" };
 }
 
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+shell_WinInetBackend_get_implementation(
+    css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const&)
+{
+    return cppu::acquire(new WinInetBackend);
+}
+
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/shell/source/backends/wininetbe/wininetbackend.hxx 
b/shell/source/backends/wininetbe/wininetbackend.hxx
index 8478f3512f46..40945f5baccd 100644
--- a/shell/source/backends/wininetbe/wininetbackend.hxx
+++ b/shell/source/backends/wininetbe/wininetbackend.hxx
@@ -35,8 +35,6 @@ class WinInetBackend : public ::cppu::WeakImplHelper <
 
     public:
 
-        static WinInetBackend* createInstance();
-
         // XServiceInfo
         virtual OUString SAL_CALL
             getImplementationName(  ) override;
@@ -47,19 +45,6 @@ class WinInetBackend : public ::cppu::WeakImplHelper <
         virtual uno::Sequence<OUString> SAL_CALL
             getSupportedServiceNames(  ) override;
 
-        /**
-          Provides the implementation name.
-
-          @return   implementation name
-          */
-        static OUString getBackendName() ;
-        /**
-          Provides the supported services names
-
-          @return   service names
-          */
-        static uno::Sequence<OUString> getBackendServiceNames() ;
-
         // XPropertySet
         virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
         getPropertySetInfo() override
@@ -91,7 +76,6 @@ class WinInetBackend : public ::cppu::WeakImplHelper <
             css::uno::Reference< css::beans::XVetoableChangeListener > const 
&) override
         {}
 
-    protected:
         /**
           Service constructor from a service factory.
 
diff --git a/shell/source/backends/wininetbe/wininetbe1.component 
b/shell/source/backends/wininetbe/wininetbe1.component
index 848b20e85289..1acdee781fe4 100644
--- a/shell/source/backends/wininetbe/wininetbe1.component
+++ b/shell/source/backends/wininetbe/wininetbe1.component
@@ -18,8 +18,9 @@
  -->
 
 <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
-    prefix="wininetbe1" xmlns="http://openoffice.org/2010/uno-components";>
-  <implementation 
name="com.sun.star.comp.configuration.backend.WinInetBackend">
+    xmlns="http://openoffice.org/2010/uno-components";>
+  <implementation name="com.sun.star.comp.configuration.backend.WinInetBackend"
+    constructor="shell_WinInetBackend_get_implementation">
     <service name="com.sun.star.configuration.backend.WinInetBackend"/>
   </implementation>
 </component>
diff --git a/shell/source/backends/wininetbe/wininetbecdef.cxx 
b/shell/source/backends/wininetbe/wininetbecdef.cxx
deleted file mode 100644
index 72fca9378d35..000000000000
--- a/shell/source/backends/wininetbe/wininetbecdef.cxx
+++ /dev/null
@@ -1,63 +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 "wininetbackend.hxx"
-#include <com/sun/star/registry/XRegistryKey.hpp>
-
-#include <cppuhelper/implementationentry.hxx>
-#include <com/sun/star/uno/XComponentContext.hpp>
-
-namespace uno = com::sun::star::uno ;
-
-
-static uno::Reference<uno::XInterface> createWinInetBackend(
-    const uno::Reference<uno::XComponentContext>&){
-
-    return * WinInetBackend::createInstance();
-}
-
-
-static const cppu::ImplementationEntry kImplementations_entries[] =
-{
-    {
-        createWinInetBackend,
-        WinInetBackend::getBackendName,
-        WinInetBackend::getBackendServiceNames,
-        cppu::createSingleComponentFactory,
-        nullptr,
-        0
-    },
-    { nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
-} ;
-
-
-extern "C" SAL_DLLPUBLIC_EXPORT void * wininetbe1_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: */
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to