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

kripton yeliztaneroglu at gmail.com
Sun Jan 31 05:31:51 PST 2016


 comphelper/source/container/NamedPropertyValuesContainer.cxx |   33 ++---------
 comphelper/source/inc/comphelper_services.hxx                |    1 
 comphelper/source/misc/comphelper_services.cxx               |    1 
 comphelper/util/comphelp.component                           |    3 -
 4 files changed, 8 insertions(+), 30 deletions(-)

New commits:
commit 9ab1bdc217792e90b1b27d81128881d57152afc8
Author: kripton <yeliztaneroglu at gmail.com>
Date:   Fri Jan 29 00:59:41 2016 +0200

    tdf#74608 comphelper: Constructor feature for NamedPropertyValuesContainer
    
    Change-Id: I63390eca5c887bfd84846655cef6339ba9785e24
    Reviewed-on: https://gerrit.libreoffice.org/21888
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Matúš Kukan <matus at libreoffice.org>

diff --git a/comphelper/source/container/NamedPropertyValuesContainer.cxx b/comphelper/source/container/NamedPropertyValuesContainer.cxx
index 90ce4cd..e4bb486 100644
--- a/comphelper/source/container/NamedPropertyValuesContainer.cxx
+++ b/comphelper/source/container/NamedPropertyValuesContainer.cxx
@@ -17,12 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-
-#include "comphelper_module.hxx"
-#include "comphelper_services.hxx"
-
 #include <com/sun/star/container/XNameContainer.hpp>
 #include <com/sun/star/uno/Sequence.h>
+#include <com/sun/star/uno/XComponentContext.hpp>
 #include <com/sun/star/beans/PropertyValue.hpp>
 #include <comphelper/sequence.hxx>
 #include <cppuhelper/implbase.hxx>
@@ -74,11 +71,6 @@ public:
     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(css::uno::RuntimeException, std::exception) override;
     virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames(  ) throw(css::uno::RuntimeException, std::exception) override;
 
-    // XServiceInfo - static versions (used for component registration)
-    static OUString SAL_CALL getImplementationName_static();
-    static uno::Sequence< OUString > SAL_CALL getSupportedServiceNames_static();
-    static uno::Reference< uno::XInterface > SAL_CALL Create( const uno::Reference< uno::XComponentContext >& );
-
 private:
     NamedPropertyValues maProperties;
 };
@@ -178,11 +170,6 @@ sal_Bool SAL_CALL NamedPropertyValuesContainer::hasElements(  )
 //XServiceInfo
 OUString SAL_CALL NamedPropertyValuesContainer::getImplementationName(  ) throw(css::uno::RuntimeException, std::exception)
 {
-    return getImplementationName_static();
-}
-
-OUString SAL_CALL NamedPropertyValuesContainer::getImplementationName_static(  )
-{
     return OUString( "NamedPropertyValuesContainer" );
 }
 
@@ -193,25 +180,17 @@ sal_Bool SAL_CALL NamedPropertyValuesContainer::supportsService( const OUString&
 
 css::uno::Sequence< OUString > SAL_CALL NamedPropertyValuesContainer::getSupportedServiceNames(  ) throw(css::uno::RuntimeException, std::exception)
 {
-    return getSupportedServiceNames_static();
-}
-
-css::uno::Sequence< OUString > SAL_CALL NamedPropertyValuesContainer::getSupportedServiceNames_static(  )
-{
     const OUString aServiceName( "com.sun.star.document.NamedPropertyValues" );
     const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
     return aSeq;
 }
 
-uno::Reference< uno::XInterface > SAL_CALL NamedPropertyValuesContainer::Create(
-                SAL_UNUSED_PARAMETER const uno::Reference< uno::XComponentContext >&)
-{
-    return static_cast<cppu::OWeakObject*>(new NamedPropertyValuesContainer());
-}
-
-void createRegistryInfo_NamedPropertyValuesContainer()
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+NamedPropertyValuesContainer_get_implementation(
+    css::uno::XComponentContext *,
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    static ::comphelper::module::OAutoRegistration< NamedPropertyValuesContainer > aAutoRegistration;
+    return cppu::acquire(new NamedPropertyValuesContainer());
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/comphelper/source/inc/comphelper_services.hxx b/comphelper/source/inc/comphelper_services.hxx
index 602ac7a..04cbcb3 100644
--- a/comphelper/source/inc/comphelper_services.hxx
+++ b/comphelper/source/inc/comphelper_services.hxx
@@ -24,7 +24,6 @@
 
 void createRegistryInfo_AnyCompareFactory();
 void createRegistryInfo_Map();
-void createRegistryInfo_NamedPropertyValuesContainer();
 void createRegistryInfo_OInstanceLocker();
 void createRegistryInfo_OPropertyBag();
 void createRegistryInfo_OSimpleLogRing();
diff --git a/comphelper/source/misc/comphelper_services.cxx b/comphelper/source/misc/comphelper_services.cxx
index fe534b7..da76ced 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_NamedPropertyValuesContainer();
                 createRegistryInfo_AnyCompareFactory();
                 createRegistryInfo_OInstanceLocker();
                 createRegistryInfo_Map();
diff --git a/comphelper/util/comphelp.component b/comphelper/util/comphelp.component
index f7b7d9a..a948150 100644
--- a/comphelper/util/comphelp.component
+++ b/comphelper/util/comphelp.component
@@ -26,7 +26,8 @@
       constructor="IndexedPropertyValuesContainer_get_implementation">
     <service name="com.sun.star.document.IndexedPropertyValues"/>
   </implementation>
-  <implementation name="NamedPropertyValuesContainer">
+  <implementation name="NamedPropertyValuesContainer"
+      constructor="NamedPropertyValuesContainer_get_implementation">
     <service name="com.sun.star.document.NamedPropertyValues"/>
   </implementation>
   <implementation name="com.sun.star.comp.MemoryStream">


More information about the Libreoffice-commits mailing list