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

Steven Guo steventimothyguo at gmail.com
Thu May 26 20:53:14 UTC 2016


 comphelper/source/inc/comphelper_services.hxx  |    1 
 comphelper/source/misc/comphelper_services.cxx |    1 
 comphelper/source/property/opropertybag.cxx    |   38 +++++--------------------
 comphelper/source/property/opropertybag.hxx    |   10 +-----
 comphelper/util/comphelp.component             |    3 +
 5 files changed, 12 insertions(+), 41 deletions(-)

New commits:
commit 85f404151e308bc1e97a0f3f15702c1c40a3b59b
Author: Steven Guo <steventimothyguo at gmail.com>
Date:   Sat Mar 26 12:35:45 2016 -0700

    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 at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/comphelper/source/inc/comphelper_services.hxx b/comphelper/source/inc/comphelper_services.hxx
index 63f2394..9d356c1 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 af1df82..23d8e7f 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 512003b..fb69439 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 214a6b8..467aee2 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 c6fc2f3..c59223d 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"


More information about the Libreoffice-commits mailing list