From 1cd5448059e71d745f4cb52e601d61505346f713 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 13 Jul 2020 20:05:42 +0200 Subject: 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 --- .../source/unourl_resolver/unourl_resolver.cxx | 43 ++++------------------ .../source/unourl_resolver/uuresolver.component | 5 ++- 2 files changed, 10 insertions(+), 38 deletions(-) (limited to 'remotebridges') 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 #include #include -#include #include -#include #include #include @@ -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 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 @@ --> - + xmlns="http://openoffice.org/2010/uno-components"> + -- cgit