summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Guo <steventimothyguo@gmail.com>2016-03-26 12:35:45 -0700
committerMichael Stahl <mstahl@redhat.com>2016-05-26 20:52:43 +0000
commit85f404151e308bc1e97a0f3f15702c1c40a3b59b (patch)
treebb58427f8c92fc0082ff6f89492abfbb6c8d83d9
parent5c05f1b201be8c1b978dc8d409f3c4dbf0b4beb6 (diff)
tdf#74608 Constructor functions for OPropertyBag
Added constructor function for OPropertyBag in /comphelper/source/property/. Change-Id: I28d6aa5c6fa2aa4324cf4ac61c5f2e3ab0a5e14a Reviewed-on: https://gerrit.libreoffice.org/23541 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--comphelper/source/inc/comphelper_services.hxx1
-rw-r--r--comphelper/source/misc/comphelper_services.cxx1
-rw-r--r--comphelper/source/property/opropertybag.cxx38
-rw-r--r--comphelper/source/property/opropertybag.hxx10
-rw-r--r--comphelper/util/comphelp.component3
5 files changed, 12 insertions, 41 deletions
diff --git a/comphelper/source/inc/comphelper_services.hxx b/comphelper/source/inc/comphelper_services.hxx
index 63f23942f6f8..9d356c17af2d 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_OPropertyBag();
void createRegistryInfo_UNOMemoryStream();
#endif
diff --git a/comphelper/source/misc/comphelper_services.cxx b/comphelper/source/misc/comphelper_services.cxx
index af1df82389f5..23d8e7f77ed5 100644
--- a/comphelper/source/misc/comphelper_services.cxx
+++ b/comphelper/source/misc/comphelper_services.cxx
@@ -34,7 +34,6 @@ namespace comphelper { namespace module
public:
doInitialize()
{
- createRegistryInfo_OPropertyBag();
createRegistryInfo_UNOMemoryStream();
createRegistryInfo_Map();
}
diff --git a/comphelper/source/property/opropertybag.cxx b/comphelper/source/property/opropertybag.cxx
index 512003beb142..fb694398d9b5 100644
--- a/comphelper/source/property/opropertybag.cxx
+++ b/comphelper/source/property/opropertybag.cxx
@@ -19,8 +19,6 @@
#include "opropertybag.hxx"
-#include "comphelper_module.hxx"
-#include "comphelper_services.hxx"
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
@@ -39,12 +37,14 @@
using namespace ::com::sun::star;
-void createRegistryInfo_OPropertyBag()
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_comp_comphelper_OPropertyBag (
+ css::uno::XComponentContext *,
+ css::uno::Sequence<css::uno::Any> const &)
{
- static ::comphelper::module::OAutoRegistration< ::comphelper::OPropertyBag > aAutoRegistration;
+ return cppu::acquire(new comphelper::OPropertyBag());
}
-
namespace comphelper
{
@@ -74,14 +74,6 @@ namespace comphelper
IMPLEMENT_FORWARD_XINTERFACE2( OPropertyBag, OPropertyBag_Base, OPropertyBag_PBase )
IMPLEMENT_FORWARD_XTYPEPROVIDER2( OPropertyBag, OPropertyBag_Base, OPropertyBag_PBase )
-
- Sequence< OUString > OPropertyBag::getSupportedServiceNames_static() throw( RuntimeException )
- {
- Sequence< OUString > aServices { "com.sun.star.beans.PropertyBag" };
- return aServices;
- }
-
-
void SAL_CALL OPropertyBag::initialize( const Sequence< Any >& _rArguments ) throw (Exception, RuntimeException, std::exception)
{
Sequence< Type > aTypes;
@@ -120,22 +112,9 @@ namespace comphelper
}
}
-
- OUString OPropertyBag::getImplementationName_static() throw( RuntimeException )
- {
- return OUString( "com.sun.star.comp.comphelper.OPropertyBag" );
- }
-
-
- Reference< XInterface > SAL_CALL OPropertyBag::Create( SAL_UNUSED_PARAMETER const Reference< XComponentContext >& )
- {
- return *new OPropertyBag;
- }
-
-
OUString SAL_CALL OPropertyBag::getImplementationName() throw (RuntimeException, std::exception)
{
- return getImplementationName_static();
+ return OUString( "com.sun.star.comp.comphelper.OPropertyBag" );
}
sal_Bool SAL_CALL OPropertyBag::supportsService( const OUString& rServiceName ) throw (RuntimeException, std::exception)
@@ -143,13 +122,12 @@ namespace comphelper
return cppu::supportsService(this, rServiceName);
}
-
Sequence< OUString > SAL_CALL OPropertyBag::getSupportedServiceNames( ) throw (RuntimeException, std::exception)
{
- return getSupportedServiceNames_static();
+ Sequence< OUString > aServices { "com.sun.star.beans.PropertyBag" };
+ return aServices;
}
-
void OPropertyBag::fireEvents(
sal_Int32 * /*pnHandles*/,
sal_Int32 nCount,
diff --git a/comphelper/source/property/opropertybag.hxx b/comphelper/source/property/opropertybag.hxx
index 214a6b82b34e..467aee20c718 100644
--- a/comphelper/source/property/opropertybag.hxx
+++ b/comphelper/source/property/opropertybag.hxx
@@ -91,16 +91,10 @@ namespace comphelper
//noncopyable
OPropertyBag(const OPropertyBag&) = delete;
const OPropertyBag& operator=(const OPropertyBag&) = delete;
-
- // XServiceInfo - static versions
- static css::uno::Sequence< OUString > getSupportedServiceNames_static() throw( css::uno::RuntimeException );
- static OUString getImplementationName_static() throw( css::uno::RuntimeException );
- static css::uno::Reference< css::uno::XInterface >
- SAL_CALL Create(const css::uno::Reference< css::uno::XComponentContext >&);
-
- protected:
OPropertyBag();
virtual ~OPropertyBag();
+
+ protected:
DECLARE_XINTERFACE()
DECLARE_XTYPEPROVIDER()
diff --git a/comphelper/util/comphelp.component b/comphelper/util/comphelp.component
index c6fc2f31bc24..c59223d40056 100644
--- a/comphelper/util/comphelp.component
+++ b/comphelper/util/comphelp.component
@@ -42,7 +42,8 @@
constructor="com_sun_star_comp_SequenceOutputStreamService">
<service name="com.sun.star.io.SequenceOutputStream"/>
</implementation>
- <implementation name="com.sun.star.comp.comphelper.OPropertyBag">
+ <implementation name="com.sun.star.comp.comphelper.OPropertyBag"
+ constructor="com_sun_star_comp_comphelper_OPropertyBag"> >
<service name="com.sun.star.beans.PropertyBag"/>
</implementation>
<implementation name="com.sun.star.comp.embed.InstanceLocker"