summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorYeliz Taneroğlu <yeliztaneroglu@gmail.com>2016-03-06 00:18:51 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-03-08 13:25:01 +0000
commitdf750471d757562671e612fe83d758231dd58b58 (patch)
tree1cc2ffdc2643db725225657e023fabdd1d4059ca /comphelper
parent9c72eca1fbec84c65b3c9733666470d94577da7a (diff)
tdf#74608 comphelper: Constructor feature for InstanceLocker
Change-Id: If2c597d56d4dde74ec8361b74bdd1933f42afa4b Reviewed-on: https://gerrit.libreoffice.org/22940 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/inc/comphelper_services.hxx1
-rw-r--r--comphelper/source/misc/comphelper_services.cxx1
-rw-r--r--comphelper/source/misc/instancelocker.cxx33
-rw-r--r--comphelper/source/misc/instancelocker.hxx8
-rw-r--r--comphelper/util/comphelp.component3
5 files changed, 9 insertions, 37 deletions
diff --git a/comphelper/source/inc/comphelper_services.hxx b/comphelper/source/inc/comphelper_services.hxx
index 318eaa65f996..d588e39192f0 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 ef136eede5f9..776f86982737 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 9c82acd31746..38370c5837b0 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 3ac86e534715..2107d7a6912d 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 71ddeea1d261..a60912bf5160 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"