binaryurp/source/binaryurp.component |    5 ++--
 binaryurp/source/bridgefactory.cxx   |   39 +++++------------------------------
 binaryurp/source/bridgefactory.hxx   |   12 ----------
 3 files changed, 10 insertions(+), 46 deletions(-)

New commits:
commit 65fc5bd895948d73f3d1eec14a669ada3e3465f0
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sat Jul 4 09:12:35 2020 +0200
Commit:     Thorsten Behrens <thorsten.behr...@allotropia.de>
CommitDate: Thu Apr 14 19:32:18 2022 +0200

    binaryurp: create instances with uno constructors
    
    See tdf#74608 for motivation
    
    Change-Id: Ide39715f83b0183f560e16fa69fcb3112496936d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97933
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    (cherry picked from commit 9be078ae0d4cc4e4c01952bb42c9bb5943bbde86)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132945
    Tested-by: Thorsten Behrens <thorsten.behr...@allotropia.de>
    Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de>

diff --git a/binaryurp/source/binaryurp.component 
b/binaryurp/source/binaryurp.component
index 1eff0c2c18d6..e2581c76411e 100644
--- a/binaryurp/source/binaryurp.component
+++ b/binaryurp/source/binaryurp.component
@@ -18,8 +18,9 @@
  -->
 
 <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
-    prefix="binaryurp" xmlns="http://openoffice.org/2010/uno-components";>
-  <implementation name="com.sun.star.comp.bridge.BridgeFactory">
+    xmlns="http://openoffice.org/2010/uno-components";>
+  <implementation name="com.sun.star.comp.bridge.BridgeFactory"
+        
constructor="com_sun_star_comp_bridge_BridgeFactory_get_implementation">
     <service name="com.sun.star.bridge.BridgeFactory"/>
   </implementation>
 </component>
diff --git a/binaryurp/source/bridgefactory.cxx 
b/binaryurp/source/bridgefactory.cxx
index 6563b101f1df..f653d40cc68c 100644
--- a/binaryurp/source/bridgefactory.cxx
+++ b/binaryurp/source/bridgefactory.cxx
@@ -43,21 +43,6 @@
 
 namespace binaryurp {
 
-css::uno::Reference< css::uno::XInterface > BridgeFactory::static_create(
-    css::uno::Reference< css::uno::XComponentContext > const & /*xContext*/)
-{
-    return static_cast< cppu::OWeakObject * >(new BridgeFactory);
-}
-
-OUString BridgeFactory::static_getImplementationName() {
-    return "com.sun.star.comp.bridge.BridgeFactory";
-}
-
-css::uno::Sequence< OUString >
-BridgeFactory::static_getSupportedServiceNames() {
-    return css::uno::Sequence<OUString>{ "com.sun.star.bridge.BridgeFactory" };
-}
-
 void BridgeFactory::removeBridge(
     css::uno::Reference< css::bridge::XBridge > const & bridge)
 {
@@ -85,7 +70,7 @@ BridgeFactory::~BridgeFactory() {}
 
 OUString BridgeFactory::getImplementationName()
 {
-    return static_getImplementationName();
+    return "com.sun.star.comp.bridge.BridgeFactory";
 }
 
 sal_Bool BridgeFactory::supportsService(OUString const & ServiceName)
@@ -95,7 +80,7 @@ sal_Bool BridgeFactory::supportsService(OUString const & 
ServiceName)
 
 css::uno::Sequence< OUString > BridgeFactory::getSupportedServiceNames()
 {
-    return static_getSupportedServiceNames();
+    return { "com.sun.star.bridge.BridgeFactory" };
 }
 
 css::uno::Reference< css::bridge::XBridge > BridgeFactory::createBridge(
@@ -198,23 +183,11 @@ void BridgeFactory::disposing() {
 
 }
 
-namespace {
-
-static cppu::ImplementationEntry const services[] = {
-    { &binaryurp::BridgeFactory::static_create,
-      &binaryurp::BridgeFactory::static_getImplementationName,
-      &binaryurp::BridgeFactory::static_getSupportedServiceNames,
-      &cppu::createOneInstanceComponentFactory, nullptr, 0 },
-    { nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
-};
-
-}
-
-extern "C" SAL_DLLPUBLIC_EXPORT void * binaryurp_component_getFactory(
-    char const * pImplName, void * pServiceManager, void * pRegistryKey)
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+com_sun_star_comp_bridge_BridgeFactory_get_implementation(
+    css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const&)
 {
-    return cppu::component_getFactoryHelper(
-        pImplName, pServiceManager, pRegistryKey, services);
+    return cppu::acquire(static_cast< cppu::OWeakObject * >(new 
binaryurp::BridgeFactory));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/binaryurp/source/bridgefactory.hxx 
b/binaryurp/source/bridgefactory.hxx
index 1a83962ee6b7..bbe2e39fd46a 100644
--- a/binaryurp/source/bridgefactory.hxx
+++ b/binaryurp/source/bridgefactory.hxx
@@ -57,16 +57,6 @@ typedef
 class BridgeFactory : private cppu::BaseMutex, public BridgeFactoryBase
 {
 public:
-    static com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
-    SAL_CALL static_create(
-        com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext 
>
-            const & xContext);
-
-    static OUString SAL_CALL static_getImplementationName();
-
-    static com::sun::star::uno::Sequence< OUString > SAL_CALL
-    static_getSupportedServiceNames();
-
     void removeBridge(
         com::sun::star::uno::Reference< com::sun::star::bridge::XBridge >
             const & bridge);
@@ -74,7 +64,6 @@ public:
     using BridgeFactoryBase::acquire;
     using BridgeFactoryBase::release;
 
-private:
     BridgeFactory(const BridgeFactory&) = delete;
     BridgeFactory& operator=(const BridgeFactory&) = delete;
 
@@ -82,6 +71,7 @@ private:
 
     virtual ~BridgeFactory() override;
 
+private:
     virtual OUString SAL_CALL getImplementationName() override;
 
     virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) 
override;

Reply via email to