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

kripton yeliztaneroglu at gmail.com
Mon Feb 1 15:02:49 UTC 2016


 comphelper/source/compare/AnyCompareFactory.cxx |   32 ++++--------------------
 comphelper/source/inc/comphelper_services.hxx   |    1 
 comphelper/source/misc/comphelper_services.cxx  |    1 
 comphelper/util/comphelp.component              |    3 +-
 4 files changed, 8 insertions(+), 29 deletions(-)

New commits:
commit a395a1137d2e9430dfd5fd20e81c9413f06a554d
Author: kripton <yeliztaneroglu at gmail.com>
Date:   Sat Jan 30 17:52:26 2016 +0200

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

diff --git a/comphelper/source/compare/AnyCompareFactory.cxx b/comphelper/source/compare/AnyCompareFactory.cxx
index 21fa21d..9eacb4f 100644
--- a/comphelper/source/compare/AnyCompareFactory.cxx
+++ b/comphelper/source/compare/AnyCompareFactory.cxx
@@ -17,13 +17,11 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include "comphelper_module.hxx"
-#include "comphelper_services.hxx"
-
 #include <com/sun/star/ucb/XAnyCompareFactory.hpp>
 #include <com/sun/star/i18n/Collator.hpp>
 #include <com/sun/star/lang/Locale.hpp>
 #include <com/sun/star/uno/Sequence.h>
+#include <com/sun/star/uno/XComponentContext.hpp>
 #include <com/sun/star/beans/PropertyValue.hpp>
 #include <cppuhelper/implbase.hxx>
 #include <cppuhelper/supportsservice.hxx>
@@ -74,11 +72,6 @@ public:
     virtual OUString SAL_CALL getImplementationName(  ) throw(RuntimeException, std::exception) override;
     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(RuntimeException, std::exception) override;
     virtual Sequence< OUString > SAL_CALL getSupportedServiceNames(  ) throw(RuntimeException, std::exception) override;
-
-    // XServiceInfo - static versions (used for component registration)
-    static OUString SAL_CALL getImplementationName_static();
-    static Sequence< OUString > SAL_CALL getSupportedServiceNames_static();
-    static Reference< XInterface > SAL_CALL Create( const Reference< XComponentContext >& );
 };
 
 sal_Int16 SAL_CALL AnyCompare::compare( const Any& any1, const Any& any2 ) throw(css::uno::RuntimeException, std::exception)
@@ -121,11 +114,6 @@ void SAL_CALL AnyCompareFactory::initialize( const Sequence< Any >& aArguments )
 
 OUString SAL_CALL AnyCompareFactory::getImplementationName(  ) throw( RuntimeException, std::exception )
 {
-    return getImplementationName_static();
-}
-
-OUString SAL_CALL AnyCompareFactory::getImplementationName_static(  )
-{
     return OUString( "AnyCompareFactory" );
 }
 
@@ -136,25 +124,17 @@ sal_Bool SAL_CALL AnyCompareFactory::supportsService( const OUString& ServiceNam
 
 Sequence< OUString > SAL_CALL AnyCompareFactory::getSupportedServiceNames(  ) throw(RuntimeException, std::exception)
 {
-    return getSupportedServiceNames_static();
-}
-
-Sequence< OUString > SAL_CALL AnyCompareFactory::getSupportedServiceNames_static(  )
-{
     const OUString aServiceName( "com.sun.star.ucb.AnyCompareFactory" );
     const Sequence< OUString > aSeq( &aServiceName, 1 );
     return aSeq;
 }
 
-Reference< XInterface > SAL_CALL AnyCompareFactory::Create(
-                const Reference< XComponentContext >& rxContext )
-{
-    return static_cast<cppu::OWeakObject*>(new AnyCompareFactory( rxContext ));
-}
-
-void createRegistryInfo_AnyCompareFactory()
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+AnyCompareFactory_get_implementation(
+    css::uno::XComponentContext *context,
+    css::uno::Sequence<css::uno::Any> const &)
 {
-    static ::comphelper::module::OAutoRegistration< AnyCompareFactory > aAutoRegistration;
+    return cppu::acquire(new AnyCompareFactory(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/comphelper/source/inc/comphelper_services.hxx b/comphelper/source/inc/comphelper_services.hxx
index 04cbcb3..0f499f3 100644
--- a/comphelper/source/inc/comphelper_services.hxx
+++ b/comphelper/source/inc/comphelper_services.hxx
@@ -22,7 +22,6 @@
 
 #include <sal/config.h>
 
-void createRegistryInfo_AnyCompareFactory();
 void createRegistryInfo_Map();
 void createRegistryInfo_OInstanceLocker();
 void createRegistryInfo_OPropertyBag();
diff --git a/comphelper/source/misc/comphelper_services.cxx b/comphelper/source/misc/comphelper_services.cxx
index da76ced..47fdf20 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_AnyCompareFactory();
                 createRegistryInfo_OInstanceLocker();
                 createRegistryInfo_Map();
                 createRegistryInfo_OSimpleLogRing();
diff --git a/comphelper/util/comphelp.component b/comphelper/util/comphelp.component
index a948150..4de65e1 100644
--- a/comphelper/util/comphelp.component
+++ b/comphelper/util/comphelp.component
@@ -19,7 +19,8 @@
 
 <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
     prefix="comphelp" xmlns="http://openoffice.org/2010/uno-components">
-  <implementation name="AnyCompareFactory">
+  <implementation name="AnyCompareFactory"
+      constructor="AnyCompareFactory_get_implementation">
     <service name="com.sun.star.ucb.AnyCompareFactory"/>
   </implementation>
   <implementation name="IndexedPropertyValuesContainer"


More information about the Libreoffice-commits mailing list