[Libreoffice-commits] core.git: remotebridges/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Tue Jul 14 10:03:50 UTC 2020


 remotebridges/source/unourl_resolver/unourl_resolver.cxx  |   43 ++------------
 remotebridges/source/unourl_resolver/uuresolver.component |    5 -
 2 files changed, 10 insertions(+), 38 deletions(-)

New commits:
commit 1cd5448059e71d745f4cb52e601d61505346f713
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Mon Jul 13 20:05:42 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Jul 14 12:03:12 2020 +0200

    remotebridges: create instances with uno constructors
    
    See tdf#74608 for motivation.
    
    Change-Id: I4e33b22fa8294d730e1efa929c352c1aefe506a1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98679
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/remotebridges/source/unourl_resolver/unourl_resolver.cxx b/remotebridges/source/unourl_resolver/unourl_resolver.cxx
index fee9e0dbdf78..9aa8293fa67b 100644
--- a/remotebridges/source/unourl_resolver/unourl_resolver.cxx
+++ b/remotebridges/source/unourl_resolver/unourl_resolver.cxx
@@ -26,9 +26,7 @@
 #include <com/sun/star/bridge/XUnoUrlResolver.hpp>
 #include <com/sun/star/connection/XConnector.hpp>
 #include <com/sun/star/registry/XRegistryKey.hpp>
-#include <cppuhelper/factory.hxx>
 #include <cppuhelper/implbase.hxx>
-#include <cppuhelper/implementationentry.hxx>
 #include <cppuhelper/supportsservice.hxx>
 #include <cppuhelper/unourl.hxx>
 
@@ -39,21 +37,9 @@ using namespace com::sun::star::connection;
 using namespace com::sun::star::bridge;
 using namespace com::sun::star::registry;
 
-#define IMPLNAME        "com.sun.star.comp.bridge.UnoUrlResolver"
-
 namespace unourl_resolver
 {
 
-static Sequence< OUString > resolver_getSupportedServiceNames()
-{
-    return { "com.sun.star.bridge.UnoUrlResolver" };
-}
-
-static OUString resolver_getImplementationName()
-{
-    return IMPLNAME;
-}
-
 namespace {
 
 class ResolverImpl : public WeakImplHelper< XServiceInfo, XUnoUrlResolver >
@@ -83,7 +69,7 @@ ResolverImpl::ResolverImpl( const Reference< XComponentContext > & xCtx )
 // XServiceInfo
 OUString ResolverImpl::getImplementationName()
 {
-    return resolver_getImplementationName();
+    return "com.sun.star.comp.bridge.UnoUrlResolver";
 }
 
 sal_Bool ResolverImpl::supportsService( const OUString & rServiceName )
@@ -93,7 +79,7 @@ sal_Bool ResolverImpl::supportsService( const OUString & rServiceName )
 
 Sequence< OUString > ResolverImpl::getSupportedServiceNames()
 {
-    return resolver_getSupportedServiceNames();
+    return { "com.sun.star.bridge.UnoUrlResolver" };
 }
 
 // XUnoUrlResolver
@@ -132,29 +118,14 @@ Reference< XInterface > ResolverImpl::resolve( const OUString & rUnoUrl )
     return xRet;
 }
 
-static Reference< XInterface > ResolverImpl_create( const Reference< XComponentContext > & xCtx )
-{
-    return Reference< XInterface >( *new ResolverImpl( xCtx ) );
-}
-
-}
-
-using namespace unourl_resolver;
 
-const struct ImplementationEntry g_entries[] =
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+remotebridges_ResolverImpl_get_implementation(
+    css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
 {
-    {
-        ResolverImpl_create, resolver_getImplementationName,
-        resolver_getSupportedServiceNames, createSingleComponentFactory,
-        nullptr, 0
-    },
-    { nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
-};
+    return cppu::acquire(new ResolverImpl(context));
+}
 
-extern "C" SAL_DLLPUBLIC_EXPORT void * uuresolver_component_getFactory(
-    const char * pImplName, void * pServiceManager, void * pRegistryKey )
-{
-    return component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey , g_entries );
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/remotebridges/source/unourl_resolver/uuresolver.component b/remotebridges/source/unourl_resolver/uuresolver.component
index 304ee2f4021b..4b830459ac54 100644
--- a/remotebridges/source/unourl_resolver/uuresolver.component
+++ b/remotebridges/source/unourl_resolver/uuresolver.component
@@ -18,8 +18,9 @@
  -->
 
 <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
-    prefix="uuresolver" xmlns="http://openoffice.org/2010/uno-components">
-  <implementation name="com.sun.star.comp.bridge.UnoUrlResolver">
+    xmlns="http://openoffice.org/2010/uno-components">
+  <implementation name="com.sun.star.comp.bridge.UnoUrlResolver"
+    constructor="remotebridges_ResolverImpl_get_implementation">
     <service name="com.sun.star.bridge.UnoUrlResolver"/>
   </implementation>
 </component>


More information about the Libreoffice-commits mailing list