[Libreoffice-commits] core.git: comphelper/source comphelper/util

Yeliz Taneroğlu yeliztaneroglu at gmail.com
Tue Mar 8 13:25:23 UTC 2016


 comphelper/source/inc/comphelper_services.hxx  |    1 
 comphelper/source/misc/comphelper_services.cxx |    1 
 comphelper/source/misc/instancelocker.cxx      |   33 +++++--------------------
 comphelper/source/misc/instancelocker.hxx      |    8 ------
 comphelper/util/comphelp.component             |    3 +-
 5 files changed, 9 insertions(+), 37 deletions(-)

New commits:
commit df750471d757562671e612fe83d758231dd58b58
Author: Yeliz Taneroğlu <yeliztaneroglu at gmail.com>
Date:   Sun Mar 6 00:18:51 2016 +0200

    tdf#74608 comphelper: Constructor feature for InstanceLocker
    
    Change-Id: If2c597d56d4dde74ec8361b74bdd1933f42afa4b
    Reviewed-on: https://gerrit.libreoffice.org/22940
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/comphelper/source/inc/comphelper_services.hxx b/comphelper/source/inc/comphelper_services.hxx
index 318eaa6..d588e391 100644
--- a/comphelper/source/inc/comphelper_services.hxx
+++ b/comphelper/source/inc/comphelper_services.hxx
@@ -23,7 +23,6 @@
 #include <sal/config.h>
 
 void createRegistryInfo_Map();
-void createRegistryInfo_OInstanceLocker();
 void createRegistryInfo_OPropertyBag();
 void createRegistryInfo_SequenceInputStream();
 void createRegistryInfo_SequenceOutputStream();
diff --git a/comphelper/source/misc/comphelper_services.cxx b/comphelper/source/misc/comphelper_services.cxx
index ef136ee..776f869 100644
--- a/comphelper/source/misc/comphelper_services.cxx
+++ b/comphelper/source/misc/comphelper_services.cxx
@@ -38,7 +38,6 @@ namespace comphelper { namespace module
                 createRegistryInfo_SequenceOutputStream();
                 createRegistryInfo_SequenceInputStream();
                 createRegistryInfo_UNOMemoryStream();
-                createRegistryInfo_OInstanceLocker();
                 createRegistryInfo_Map();
             }
         };
diff --git a/comphelper/source/misc/instancelocker.cxx b/comphelper/source/misc/instancelocker.cxx
index 9c82acd..38370c5 100644
--- a/comphelper/source/misc/instancelocker.cxx
+++ b/comphelper/source/misc/instancelocker.cxx
@@ -18,10 +18,9 @@
  */
 
 
-#include "comphelper_module.hxx"
-#include "comphelper_services.hxx"
 #include <cppuhelper/supportsservice.hxx>
 
+#include <com/sun/star/uno/XComponentContext.hpp>
 #include <com/sun/star/util/XCloseBroadcaster.hpp>
 #include <com/sun/star/util/XCloseable.hpp>
 #include <com/sun/star/lang/DisposedException.hpp>
@@ -190,7 +189,7 @@ void SAL_CALL OInstanceLocker::initialize( const uno::Sequence< uno::Any >& aArg
 OUString SAL_CALL OInstanceLocker::getImplementationName(  )
     throw (uno::RuntimeException, std::exception)
 {
-    return getImplementationName_static();
+    return OUString( "com.sun.star.comp.embed.InstanceLocker" );
 }
 
 sal_Bool SAL_CALL OInstanceLocker::supportsService( const OUString& ServiceName )
@@ -202,31 +201,10 @@ sal_Bool SAL_CALL OInstanceLocker::supportsService( const OUString& ServiceName
 uno::Sequence< OUString > SAL_CALL OInstanceLocker::getSupportedServiceNames()
     throw (uno::RuntimeException, std::exception)
 {
-    return getSupportedServiceNames_static();
-}
-
-// Static methods
-
-uno::Sequence< OUString > SAL_CALL OInstanceLocker::getSupportedServiceNames_static()
-{
     const OUString aServiceName( "com.sun.star.embed.InstanceLocker" );
     return uno::Sequence< OUString >( &aServiceName, 1 );
 }
 
-
-OUString SAL_CALL OInstanceLocker::getImplementationName_static()
-{
-    return OUString( "com.sun.star.comp.embed.InstanceLocker" );
-}
-
-
-uno::Reference< uno::XInterface > SAL_CALL OInstanceLocker::Create(
-                                const uno::Reference< uno::XComponentContext >&  )
-{
-    return static_cast< cppu::OWeakObject * >( new OInstanceLocker );
-}
-
-
 // OLockListener
 
 
@@ -478,9 +456,12 @@ void OLockListener::Init()
     m_bInitialized = true;
 }
 
-void createRegistryInfo_OInstanceLocker()
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_comp_embed_InstanceLocker(
+    css::uno::XComponentContext *,
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    static ::comphelper::module::OAutoRegistration< OInstanceLocker > aAutoRegistration;
+    return cppu::acquire(new OInstanceLocker());
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/comphelper/source/misc/instancelocker.hxx b/comphelper/source/misc/instancelocker.hxx
index 3ac86e5..2107d7a 100644
--- a/comphelper/source/misc/instancelocker.hxx
+++ b/comphelper/source/misc/instancelocker.hxx
@@ -56,14 +56,6 @@ public:
     explicit OInstanceLocker();
     virtual ~OInstanceLocker();
 
-    static css::uno::Sequence< OUString > SAL_CALL
-            getSupportedServiceNames_static();
-
-    static OUString SAL_CALL getImplementationName_static();
-
-    static css::uno::Reference< css::uno::XInterface > SAL_CALL
-        Create(const css::uno::Reference< css::uno::XComponentContext >& rxContext );
-
 // XComponent
     virtual void SAL_CALL dispose() throw (css::uno::RuntimeException, std::exception) override;
     virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) throw (css::uno::RuntimeException, std::exception) override;
diff --git a/comphelper/util/comphelp.component b/comphelper/util/comphelp.component
index 71ddeea..a60912b 100644
--- a/comphelper/util/comphelp.component
+++ b/comphelper/util/comphelp.component
@@ -43,7 +43,8 @@
   <implementation name="com.sun.star.comp.comphelper.OPropertyBag">
     <service name="com.sun.star.beans.PropertyBag"/>
   </implementation>
-  <implementation name="com.sun.star.comp.embed.InstanceLocker">
+  <implementation name="com.sun.star.comp.embed.InstanceLocker"
+      constructor="com_sun_star_comp_embed_InstanceLocker">
     <service name="com.sun.star.embed.InstanceLocker"/>
   </implementation>
   <implementation name="com.sun.star.comp.logging.SimpleLogRing"


More information about the Libreoffice-commits mailing list