[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source sw/util

Stephan Bergmann sbergman at redhat.com
Thu Mar 12 02:05:29 PDT 2015


 sw/inc/finalthreadmanager.hxx                 |   11 ---
 sw/source/core/docnode/finalthreadmanager.cxx |   34 +++--------
 sw/source/core/inc/unofreg.hxx                |   19 ------
 sw/source/core/layout/dumpfilter.cxx          |   33 +++--------
 sw/source/uibase/inc/SwXFilterOptions.hxx     |    8 --
 sw/source/uibase/inc/unomailmerge.hxx         |    4 -
 sw/source/uibase/uno/SwXFilterOptions.cxx     |   27 +++------
 sw/source/uibase/uno/unoatxt.cxx              |   37 ++++--------
 sw/source/uibase/uno/unofreg.cxx              |   78 ++++++--------------------
 sw/source/uibase/uno/unomailmerge.cxx         |   28 ---------
 sw/source/uibase/uno/unomod.cxx               |   32 +++-------
 sw/util/sw.component                          |   17 +++--
 12 files changed, 88 insertions(+), 240 deletions(-)

New commits:
commit 1c363fadccb5b0df92ecf0fa304e547092cba88d
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Mar 12 10:04:52 2015 +0100

    Clean up previous commit
    
    Change-Id: I76dbe81308a9a12a04d77a794bb1d11bfb2d5125

diff --git a/sw/inc/finalthreadmanager.hxx b/sw/inc/finalthreadmanager.hxx
index ce51064..babeba5 100644
--- a/sw/inc/finalthreadmanager.hxx
+++ b/sw/inc/finalthreadmanager.hxx
@@ -34,15 +34,6 @@ class CancelJobsThread;
 class TerminateOfficeThread;
 class SwPauseThreadStarting;
 
-// service helper namespace
-namespace comp_FinalThreadManager {
-
-// component and service helper functions:
-OUString SAL_CALL _getImplementationName();
-com::sun::star::uno::Sequence< OUString > SAL_CALL _getSupportedServiceNames();
-
-} // closing service helper namespace
-
 class FinalThreadManager : public ::cppu::WeakImplHelper3< com::sun::star::lang::XServiceInfo,
                                                            com::sun::star::util::XJobManager,
                                                            com::sun::star::frame::XTerminateListener2 >
diff --git a/sw/source/core/docnode/finalthreadmanager.cxx b/sw/source/core/docnode/finalthreadmanager.cxx
index 3683f0a..bb7e97f 100644
--- a/sw/source/core/docnode/finalthreadmanager.cxx
+++ b/sw/source/core/docnode/finalthreadmanager.cxx
@@ -284,7 +284,7 @@ FinalThreadManager::~FinalThreadManager()
 // com.sun.star.uno.XServiceInfo:
 OUString SAL_CALL FinalThreadManager::getImplementationName() throw (css::uno::RuntimeException, std::exception)
 {
-    return comp_FinalThreadManager::_getImplementationName();
+    return OUString("com.sun.star.util.comp.FinalThreadManager");
 }
 
 sal_Bool SAL_CALL FinalThreadManager::supportsService(OUString const & serviceName) throw (css::uno::RuntimeException, std::exception)
@@ -294,7 +294,9 @@ sal_Bool SAL_CALL FinalThreadManager::supportsService(OUString const & serviceNa
 
 css::uno::Sequence< OUString > SAL_CALL FinalThreadManager::getSupportedServiceNames() throw (css::uno::RuntimeException, std::exception)
 {
-    return comp_FinalThreadManager::_getSupportedServiceNames();
+    css::uno::Sequence< OUString > s(1);
+    s[0] = "com.sun.star.util.JobManager";
+    return s;
 }
 
 // ::com::sun::star::util::XJobManager:
@@ -442,24 +444,6 @@ void SAL_CALL FinalThreadManager::disposing( const css::lang::EventObject& ) thr
     // nothing to do, because instance doesn't hold any references of observed objects
 }
 
-// component helper namespace
-namespace comp_FinalThreadManager {
-
-    OUString SAL_CALL _getImplementationName()
-    {
-        return OUString("com.sun.star.util.comp.FinalThreadManager");
-    }
-
-    css::uno::Sequence< OUString > SAL_CALL _getSupportedServiceNames()
-    {
-        css::uno::Sequence< OUString > s(1);
-        s[0] = "com.sun.star.util.JobManager";
-        return s;
-    }
-
-} // closing component helper namespace
-
-
 extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
 com_sun_star_util_comp_FinalThreadManager_get_implementation(::com::sun::star::uno::XComponentContext* context,
                                 ::com::sun::star::uno::Sequence<css::uno::Any> const &)
diff --git a/sw/source/core/inc/unofreg.hxx b/sw/source/core/inc/unofreg.hxx
index 0e7d087..962baac 100644
--- a/sw/source/core/inc/unofreg.hxx
+++ b/sw/source/core/inc/unofreg.hxx
@@ -39,22 +39,6 @@ css::uno::Sequence< OUString > SAL_CALL SwTextDocument_getSupportedServiceNames(
 OUString SAL_CALL SwTextDocument_getImplementationName() throw();
 css::uno::Reference< css::uno::XInterface > SAL_CALL SwTextDocument_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory > &rSMgr, const sal_uInt64 _nCreationFlags ) throw( css::uno::Exception );
 
-//API objects
-css::uno::Sequence< OUString > SAL_CALL SwXAutoTextContainer_getSupportedServiceNames() throw();
-OUString SAL_CALL SwXAutoTextContainer_getImplementationName() throw();
-css::uno::Reference< css::uno::XInterface > SAL_CALL SwXAutoTextContainer_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr) throw( css::uno::Exception );
-
-css::uno::Sequence< OUString > SAL_CALL SwXModule_getSupportedServiceNames() throw();
-OUString SAL_CALL SwXModule_getImplementationName() throw();
-
-css::uno::Sequence< OUString > SAL_CALL SwXMailMerge_getSupportedServiceNames() throw();
-OUString SAL_CALL SwXMailMerge_getImplementationName() throw();
-css::uno::Reference< css::uno::XInterface > SAL_CALL SwXMailMerge_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr) throw( css::uno::Exception );
-
-// Layout dump filter
-css::uno::Sequence< OUString > SAL_CALL LayoutDumpFilter_getSupportedServiceNames() throw();
-OUString SAL_CALL LayoutDumpFilter_getImplementationName() throw();
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/dumpfilter.cxx b/sw/source/core/layout/dumpfilter.cxx
index 9b7d3fe..326491a 100644
--- a/sw/source/core/layout/dumpfilter.cxx
+++ b/sw/source/core/layout/dumpfilter.cxx
@@ -8,7 +8,6 @@
  */
 
 #include "dumpfilter.hxx"
-#include "unofreg.hxx"
 
 #include <wrtsh.hxx>
 #include <cppuhelper/supportsservice.hxx>
@@ -22,18 +21,6 @@
 
 using namespace ::com::sun::star;
 
-OUString SAL_CALL LayoutDumpFilter_getImplementationName() throw()
-{
-    return OUString( "com.sun.star.comp.Writer.LayoutDump" );
-}
-
-uno::Sequence< OUString > SAL_CALL LayoutDumpFilter_getSupportedServiceNames() throw()
-{
-    uno::Sequence< OUString > aSeq( 1 );
-    aSeq[0] = "com.sun.star.document.ExportFilter";
-    return aSeq;
-}
-
 namespace
 {
     int writeCallback( void* pContext, const char* sBuffer, int nLen )
@@ -156,7 +143,7 @@ namespace sw
     OUString LayoutDumpFilter::getImplementationName(  )
         throw (uno::RuntimeException, std::exception)
     {
-        return LayoutDumpFilter_getImplementationName();
+        return OUString( "com.sun.star.comp.Writer.LayoutDump" );
     }
 
     sal_Bool LayoutDumpFilter::supportsService( const OUString& rServiceName )
@@ -168,7 +155,9 @@ namespace sw
     uno::Sequence< OUString > LayoutDumpFilter::getSupportedServiceNames()
         throw (uno::RuntimeException, std::exception)
     {
-        return LayoutDumpFilter_getSupportedServiceNames();
+        uno::Sequence< OUString > aSeq( 1 );
+        aSeq[0] = "com.sun.star.document.ExportFilter";
+        return aSeq;
     }
 
 } // Namespace sw
diff --git a/sw/source/uibase/inc/SwXFilterOptions.hxx b/sw/source/uibase/inc/SwXFilterOptions.hxx
index 32a1bc5..12cb723 100644
--- a/sw/source/uibase/inc/SwXFilterOptions.hxx
+++ b/sw/source/uibase/inc/SwXFilterOptions.hxx
@@ -51,9 +51,6 @@ public:
                             SwXFilterOptions();
     virtual                 ~SwXFilterOptions();
 
-    static OUString  getImplementationName_Static();
-    static ::com::sun::star::uno::Sequence< OUString> getSupportedServiceNames_Static();
-
                             // XPropertyAccess
     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
                             SAL_CALL getPropertyValues() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
diff --git a/sw/source/uibase/inc/unomailmerge.hxx b/sw/source/uibase/inc/unomailmerge.hxx
index 8e3ac4c..6ede6aa 100644
--- a/sw/source/uibase/inc/unomailmerge.hxx
+++ b/sw/source/uibase/inc/unomailmerge.hxx
@@ -169,10 +169,6 @@ public:
     virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames(  ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
 };
 
-extern com::sun::star::uno::Sequence< OUString > SAL_CALL SwXMailMerge_getSupportedServiceNames() throw();
-extern OUString SAL_CALL SwXMailMerge_getImplementationName() throw();
-extern com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL SwXMailMerge_createInstance(const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > & rSMgr) throw( com::sun::star::uno::Exception );
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/uno/SwXFilterOptions.cxx b/sw/source/uibase/uno/SwXFilterOptions.cxx
index 96d46a4..df68232 100644
--- a/sw/source/uibase/uno/SwXFilterOptions.cxx
+++ b/sw/source/uibase/uno/SwXFilterOptions.cxx
@@ -39,7 +39,6 @@ using namespace ::com::sun::star::ui::dialogs;
 using namespace ::com::sun::star::document;
 using namespace ::com::sun::star::lang;
 
-#define SWFILTEROPTIONSOBJ_IMPLNAME     "com.sun.star.comp.Writer.FilterOptionsDialog"
 #define FILTER_OPTIONS_NAME             "FilterOptions"
 
 SwXFilterOptions::SwXFilterOptions() :
@@ -51,17 +50,6 @@ SwXFilterOptions::~SwXFilterOptions()
 {
 }
 
-OUString  SwXFilterOptions::getImplementationName_Static()
-{
-    return OUString(SWFILTEROPTIONSOBJ_IMPLNAME);
-}
-
-uno::Sequence< OUString> SwXFilterOptions::getSupportedServiceNames_Static()
-{
-    OUString sService("com.sun.star.ui.dialogs.FilterOptionsDialog");
-    return uno::Sequence< OUString> (&sService, 1);
-}
-
 uno::Sequence< beans::PropertyValue > SwXFilterOptions::getPropertyValues() throw (uno::RuntimeException, std::exception)
 {
     uno::Sequence<beans::PropertyValue> aRet(1);
@@ -151,7 +139,7 @@ void   SwXFilterOptions::setSourceDocument( const uno::Reference<XComponent >& x
 
 OUString SwXFilterOptions::getImplementationName() throw(uno::RuntimeException, std::exception)
 {
-    return OUString(SWFILTEROPTIONSOBJ_IMPLNAME);
+    return OUString("com.sun.star.comp.Writer.FilterOptionsDialog");
 }
 
 sal_Bool SwXFilterOptions::supportsService( const OUString& rServiceName )
@@ -163,7 +151,8 @@ sal_Bool SwXFilterOptions::supportsService( const OUString& rServiceName )
 uno::Sequence< OUString > SwXFilterOptions::getSupportedServiceNames()
                 throw(uno::RuntimeException, std::exception)
 {
-    return SwXFilterOptions::getSupportedServiceNames_Static();
+    OUString sService("com.sun.star.ui.dialogs.FilterOptionsDialog");
+    return uno::Sequence< OUString> (&sService, 1);
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
diff --git a/sw/source/uibase/uno/unoatxt.cxx b/sw/source/uibase/uno/unoatxt.cxx
index d3641ff..497b95d 100644
--- a/sw/source/uibase/uno/unoatxt.cxx
+++ b/sw/source/uibase/uno/unoatxt.cxx
@@ -59,27 +59,6 @@
 
 using namespace ::com::sun::star;
 
-uno::Reference< uno::XInterface > SAL_CALL SwXAutoTextContainer_createInstance(
-    const uno::Reference< lang::XMultiServiceFactory > & ) throw( uno::Exception )
-{
-    //the module may not be loaded
-    SolarMutexGuard aGuard;
-    SwGlobals::ensure();
-    return (cppu::OWeakObject*)new SwXAutoTextContainer();
-}
-
-uno::Sequence< OUString > SAL_CALL SwXAutoTextContainer_getSupportedServiceNames() throw()
-{
-    OUString sService("com.sun.star.text.AutoTextContainer");
-    const uno::Sequence< OUString > aSeq( &sService, 1 );
-    return aSeq;
-}
-
-OUString SAL_CALL SwXAutoTextContainer_getImplementationName() throw()
-{
-    return OUString("SwXAutoTextContainer" );
-}
-
 SwXAutoTextContainer::SwXAutoTextContainer()
 {
     pGlossaries = ::GetGlossaries();
@@ -220,7 +199,7 @@ void SwXAutoTextContainer::removeByName(const OUString& aGroupName)
 
 OUString SwXAutoTextContainer::getImplementationName(void) throw( uno::RuntimeException, std::exception )
 {
-    return SwXAutoTextContainer_getImplementationName();
+    return OUString("SwXAutoTextContainer" );
 }
 
 sal_Bool SwXAutoTextContainer::supportsService(const OUString& rServiceName) throw( uno::RuntimeException, std::exception )
@@ -230,7 +209,9 @@ sal_Bool SwXAutoTextContainer::supportsService(const OUString& rServiceName) thr
 
 uno::Sequence< OUString > SwXAutoTextContainer::getSupportedServiceNames(void) throw( uno::RuntimeException, std::exception )
 {
-    return SwXAutoTextContainer_getSupportedServiceNames();
+    OUString sService("com.sun.star.text.AutoTextContainer");
+    const uno::Sequence< OUString > aSeq( &sService, 1 );
+    return aSeq;
 }
 
 namespace
diff --git a/sw/source/uibase/uno/unomailmerge.cxx b/sw/source/uibase/uno/unomailmerge.cxx
index 8564df6..394ce27 100644
--- a/sw/source/uibase/uno/unomailmerge.cxx
+++ b/sw/source/uibase/uno/unomailmerge.cxx
@@ -1190,8 +1190,7 @@ void SAL_CALL SwXMailMerge::removeMailMergeEventListener(
 OUString SAL_CALL SwXMailMerge::getImplementationName()
     throw(RuntimeException, std::exception)
 {
-    SolarMutexGuard aGuard;
-    return SwXMailMerge_getImplementationName();
+    return OUString( "SwXMailMerge" );
 }
 
 sal_Bool SAL_CALL SwXMailMerge::supportsService( const OUString& rServiceName )
@@ -1203,13 +1202,6 @@ sal_Bool SAL_CALL SwXMailMerge::supportsService( const OUString& rServiceName )
 uno::Sequence< OUString > SAL_CALL SwXMailMerge::getSupportedServiceNames()
     throw(RuntimeException, std::exception)
 {
-    SolarMutexGuard aGuard;
-    return SwXMailMerge_getSupportedServiceNames();
-}
-
-uno::Sequence< OUString > SAL_CALL SwXMailMerge_getSupportedServiceNames()
-    throw()
-{
     uno::Sequence< OUString > aNames(2);
     OUString *pName = aNames.getArray();
     pName[0] = "com.sun.star.text.MailMerge";
@@ -1217,10 +1209,4 @@ uno::Sequence< OUString > SAL_CALL SwXMailMerge_getSupportedServiceNames()
     return aNames;
 }
 
-OUString SAL_CALL SwXMailMerge_getImplementationName()
-    throw()
-{
-    return OUString( "SwXMailMerge" );
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/uno/unomod.cxx b/sw/source/uibase/uno/unomod.cxx
index 4e9009d..477a9e4 100644
--- a/sw/source/uibase/uno/unomod.cxx
+++ b/sw/source/uibase/uno/unomod.cxx
@@ -19,7 +19,6 @@
 
 #include <swtypes.hxx>
 #include <osl/diagnose.h>
-#include <unofreg.hxx>
 #include <unomod.hxx>
 #include <unomid.h>
 #include <unoprnms.hxx>
@@ -192,24 +191,6 @@ static ChainablePropertySetInfo * lcl_createPrintSettingsInfo()
     return new ChainablePropertySetInfo ( aPrintSettingsMap_Impl );
 }
 
-Reference< uno::XInterface > SAL_CALL SwXModule_createInstance(
-    const Reference< XMultiServiceFactory > & /*rSMgr*/) throw( Exception )
-{
-    return (cppu::OWeakObject*)new SwXModule();
-}
-
-Sequence< OUString > SAL_CALL SwXModule_getSupportedServiceNames() throw()
-{
-    OUString sService( "com.sun.star.text.GlobalSettings");
-    const Sequence< OUString > aSeq( &sService, 1 );
-    return aSeq;
-}
-
-OUString SAL_CALL SwXModule_getImplementationName() throw()
-{
-    return OUString( "SwXModule"  );
-}
-
 SwXModule::SwXModule() :
     pxViewSettings(0),
     pxPrintSettings(0)
@@ -248,7 +229,7 @@ Reference< XPropertySet >  SwXModule::getPrintSettings(void) throw( uno::Runtime
 
 OUString SwXModule::getImplementationName(void) throw( RuntimeException, std::exception )
 {
-    return SwXModule_getImplementationName();
+    return OUString( "SwXModule"  );
 }
 
 sal_Bool SwXModule::supportsService(const OUString& rServiceName) throw( RuntimeException, std::exception )
@@ -258,7 +239,9 @@ sal_Bool SwXModule::supportsService(const OUString& rServiceName) throw( Runtime
 
 Sequence< OUString > SwXModule::getSupportedServiceNames(void) throw( RuntimeException, std::exception )
 {
-    return SwXModule_getSupportedServiceNames();
+    OUString sService( "com.sun.star.text.GlobalSettings");
+    const Sequence< OUString > aSeq( &sService, 1 );
+    return aSeq;
 }
 
 SwXPrintSettings::SwXPrintSettings(SwXPrintSettingsType eType, SwDoc* pDoc)
diff --git a/sw/util/sw.component b/sw/util/sw.component
index e89271f..010f41b 100644
--- a/sw/util/sw.component
+++ b/sw/util/sw.component
@@ -18,10 +18,12 @@
  -->
 <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
     prefix="sw" xmlns="http://openoffice.org/2010/uno-components">
-  <implementation name="SwXAutoTextContainer" constructor="SwXAutoTextContainer_get_implementation">
+  <implementation name="SwXAutoTextContainer"
+      constructor="SwXAutoTextContainer_get_implementation">
     <service name="com.sun.star.text.AutoTextContainer"/>
   </implementation>
-  <implementation name="SwXMailMerge" constructor="SwXMailMerge_get_implementation">
+  <implementation name="SwXMailMerge"
+      constructor="SwXMailMerge_get_implementation">
     <service name="com.sun.star.sdb.DataAccessDescriptor"/>
     <service name="com.sun.star.text.MailMerge"/>
   </implementation>
commit b47901e5831e480caacab837b1c8a999ae515c02
Author: Chris Sherlock <chris.sherlock at collabora.com>
Date:   Mon Feb 23 11:51:18 2015 +1100

    sw: further components converted to constructor method
    
    Signed-off-by: Stephan Bergmann <sbergman at redhat.com>, with fixes for:
    * copy missing parts from SwXAutoTextContainer_createInstance to
      SwXAutoTextContainer_get_implementation
    * include (dummy) SwXMailMerge_get_implementation if
      !HAVE_FEATURE_DBCONNECTIVITY
    
    Change-Id: I36f5b5cad42bda55139bdf96d9a0621dc5ec2419

diff --git a/sw/inc/finalthreadmanager.hxx b/sw/inc/finalthreadmanager.hxx
index c2d489c..ce51064 100644
--- a/sw/inc/finalthreadmanager.hxx
+++ b/sw/inc/finalthreadmanager.hxx
@@ -40,8 +40,6 @@ namespace comp_FinalThreadManager {
 // component and service helper functions:
 OUString SAL_CALL _getImplementationName();
 com::sun::star::uno::Sequence< OUString > SAL_CALL _getSupportedServiceNames();
-com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL _create(
-    com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > const & context );
 
 } // closing service helper namespace
 
diff --git a/sw/source/core/docnode/finalthreadmanager.cxx b/sw/source/core/docnode/finalthreadmanager.cxx
index b055c15..3683f0a 100644
--- a/sw/source/core/docnode/finalthreadmanager.cxx
+++ b/sw/source/core/docnode/finalthreadmanager.cxx
@@ -457,12 +457,14 @@ namespace comp_FinalThreadManager {
         return s;
     }
 
-    css::uno::Reference< css::uno::XInterface > SAL_CALL _create(
-        const css::uno::Reference< css::uno::XComponentContext > & context)
-    {
-        return static_cast< ::cppu::OWeakObject * >(new FinalThreadManager(context));
-    }
-
 } // closing component helper namespace
 
+
+extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
+com_sun_star_util_comp_FinalThreadManager_get_implementation(::com::sun::star::uno::XComponentContext* context,
+                                ::com::sun::star::uno::Sequence<css::uno::Any> const &)
+{
+    return cppu::acquire(new FinalThreadManager(context));
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/unofreg.hxx b/sw/source/core/inc/unofreg.hxx
index 0b49ffd..0e7d087 100644
--- a/sw/source/core/inc/unofreg.hxx
+++ b/sw/source/core/inc/unofreg.hxx
@@ -46,7 +46,6 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL SwXAutoTextContainer_create
 
 css::uno::Sequence< OUString > SAL_CALL SwXModule_getSupportedServiceNames() throw();
 OUString SAL_CALL SwXModule_getImplementationName() throw();
-css::uno::Reference< css::uno::XInterface > SAL_CALL SwXModule_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr) throw( css::uno::Exception );
 
 css::uno::Sequence< OUString > SAL_CALL SwXMailMerge_getSupportedServiceNames() throw();
 OUString SAL_CALL SwXMailMerge_getImplementationName() throw();
@@ -55,8 +54,6 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL SwXMailMerge_createInstance
 // Layout dump filter
 css::uno::Sequence< OUString > SAL_CALL LayoutDumpFilter_getSupportedServiceNames() throw();
 OUString SAL_CALL LayoutDumpFilter_getImplementationName() throw();
-css::uno::Reference< css::uno::XInterface > SAL_CALL LayoutDumpFilter_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory > &rSMgr ) throw( css::uno::Exception );
-
 
 #endif
 
diff --git a/sw/source/core/layout/dumpfilter.cxx b/sw/source/core/layout/dumpfilter.cxx
index 672bab30..9b7d3fe 100644
--- a/sw/source/core/layout/dumpfilter.cxx
+++ b/sw/source/core/layout/dumpfilter.cxx
@@ -34,13 +34,6 @@ uno::Sequence< OUString > SAL_CALL LayoutDumpFilter_getSupportedServiceNames() t
     return aSeq;
 }
 
-uno::Reference< uno::XInterface > SAL_CALL LayoutDumpFilter_createInstance(
-                const uno::Reference< lang::XMultiServiceFactory > & )
-    throw (css::uno::Exception)
-{
-    return static_cast< cppu::OWeakObject* >( new sw::LayoutDumpFilter( ) );
-}
-
 namespace
 {
     int writeCallback( void* pContext, const char* sBuffer, int nLen )
@@ -180,4 +173,11 @@ namespace sw
 
 } // Namespace sw
 
+
+extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
+com_sun_star_comp_Writer_LayoutDump_get_implementation(::com::sun::star::uno::XComponentContext*,
+                                ::com::sun::star::uno::Sequence<css::uno::Any> const &)
+{
+    return cppu::acquire(new sw::LayoutDumpFilter());
+}
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/inc/SwXFilterOptions.hxx b/sw/source/uibase/inc/SwXFilterOptions.hxx
index 4c583d6..32a1bc5 100644
--- a/sw/source/uibase/inc/SwXFilterOptions.hxx
+++ b/sw/source/uibase/inc/SwXFilterOptions.hxx
@@ -92,11 +92,6 @@ public:
 
 };
 
-::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
-    SwXFilterOptions_createInstance(
-        const ::com::sun::star::uno::Reference<
-            ::com::sun::star::lang::XMultiServiceFactory >& );
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/uno/SwXFilterOptions.cxx b/sw/source/uibase/uno/SwXFilterOptions.cxx
index fef02b7..96d46a4 100644
--- a/sw/source/uibase/uno/SwXFilterOptions.cxx
+++ b/sw/source/uibase/uno/SwXFilterOptions.cxx
@@ -166,12 +166,16 @@ uno::Sequence< OUString > SwXFilterOptions::getSupportedServiceNames()
     return SwXFilterOptions::getSupportedServiceNames_Static();
 }
 
-uno::Reference<uno::XInterface> SAL_CALL SwXFilterOptions_createInstance(
-                        const uno::Reference<lang::XMultiServiceFactory>& )
+extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
+com_sun_star_comp_Writer_FilterOptionsDialog_get_implementation(::com::sun::star::uno::XComponentContext*,
+                                ::com::sun::star::uno::Sequence<css::uno::Any> const &)
 {
     SolarMutexGuard aGuard;
+
+    //the module may not be loaded
     SwGlobals::ensure();
-    return (::cppu::OWeakObject*) new SwXFilterOptions;
+    return cppu::acquire(new SwXFilterOptions());
+
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/uno/unoatxt.cxx b/sw/source/uibase/uno/unoatxt.cxx
index 003e89d..d3641ff 100644
--- a/sw/source/uibase/uno/unoatxt.cxx
+++ b/sw/source/uibase/uno/unoatxt.cxx
@@ -1111,4 +1111,14 @@ void SwAutoTextEventDescriptor::getByName(
     }
 }
 
+extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
+SwXAutoTextContainer_get_implementation(::com::sun::star::uno::XComponentContext*,
+        ::com::sun::star::uno::Sequence<css::uno::Any> const &)
+{
+    //the module may not be loaded
+    SolarMutexGuard aGuard;
+    SwGlobals::ensure();
+    return cppu::acquire(new SwXAutoTextContainer());
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/uno/unofreg.cxx b/sw/source/uibase/uno/unofreg.cxx
index c5b2138..4ad389b 100644
--- a/sw/source/uibase/uno/unofreg.cxx
+++ b/sw/source/uibase/uno/unofreg.cxx
@@ -20,11 +20,14 @@
 #include <config_features.h>
 
 #include "SwXFilterOptions.hxx"
+#include "swdll.hxx"
 #include "unofreg.hxx"
+#include "unomailmerge.hxx"
 #include <sal/types.h>
 #include <osl/diagnose.h>
 #include <cppuhelper/factory.hxx>
 #include <sfx2/sfxmodelfactory.hxx>
+#include <vcl/svapp.hxx>
 
 #include <string.h>
 
@@ -38,18 +41,10 @@ using namespace ::com::sun::star::lang;
 extern "C"
 {
 
-static ::cppu::ImplementationEntry const entries[] = {
-    { &comp_FinalThreadManager::_create,
-      &comp_FinalThreadManager::_getImplementationName,
-      &comp_FinalThreadManager::_getSupportedServiceNames,
-      &::cppu::createSingleComponentFactory, 0, 0 },
-    { 0, 0, 0, 0, 0, 0 }
-};
-
 SAL_DLLPUBLIC_EXPORT void * SAL_CALL sw_component_getFactory(
     const sal_Char * pImplName,
     void * pServiceManager,
-    void * pRegistryKey )
+    void * )
 {
     void * pRet = 0;
     if( pServiceManager )
@@ -60,41 +55,7 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL sw_component_getFactory(
         uno::Reference< XSingleServiceFactory > xFactory;
 
         const sal_Int32 nImplNameLen = strlen( pImplName );
-        if( SwXAutoTextContainer_getImplementationName().equalsAsciiL(
-                                                    pImplName, nImplNameLen ) )
-        {
-            xFactory = ::cppu::createSingleFactory( xMSF,
-                SwXAutoTextContainer_getImplementationName(),
-                SwXAutoTextContainer_createInstance,
-                SwXAutoTextContainer_getSupportedServiceNames() );
-        }
-        else if( SwXModule_getImplementationName().equalsAsciiL(
-                                                    pImplName, nImplNameLen ) )
-        {
-            xFactory = ::cppu::createSingleFactory( xMSF,
-                SwXModule_getImplementationName(),
-                SwXModule_createInstance,
-                SwXModule_getSupportedServiceNames() );
-        }
-#if HAVE_FEATURE_DBCONNECTIVITY
-        else if( SwXMailMerge_getImplementationName().equalsAsciiL(
-                                                    pImplName, nImplNameLen ) )
-        {
-            xFactory = ::cppu::createSingleFactory( xMSF,
-                SwXMailMerge_getImplementationName(),
-                SwXMailMerge_createInstance,
-                SwXMailMerge_getSupportedServiceNames() );
-        }
-#endif
-        else if( SwXFilterOptions::getImplementationName_Static().equalsAsciiL(
-                                                    pImplName, nImplNameLen ) )
-        {
-            xFactory = ::cppu::createSingleFactory( xMSF,
-                SwXFilterOptions::getImplementationName_Static(),
-                SwXFilterOptions_createInstance,
-                SwXFilterOptions::getSupportedServiceNames_Static() );
-        }
-        else if( SwTextDocument_getImplementationName().equalsAsciiL(
+        if( SwTextDocument_getImplementationName().equalsAsciiL(
                                                     pImplName, nImplNameLen ) )
         {
             xFactory = ::sfx2::createSfxModelFactory( xMSF,
@@ -110,20 +71,6 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL sw_component_getFactory(
                 SwUnoModule_createInstance,
                 SwUnoModule_getSupportedServiceNames() );
         }
-        else if( LayoutDumpFilter_getImplementationName().equalsAsciiL(
-                                                    pImplName, nImplNameLen ) )
-        {
-            xFactory = ::cppu::createSingleFactory( xMSF,
-                LayoutDumpFilter_getImplementationName(),
-                LayoutDumpFilter_createInstance,
-                LayoutDumpFilter_getSupportedServiceNames() );
-        }
-        else if( comp_FinalThreadManager::_getImplementationName().equalsAsciiL(
-                                                    pImplName, nImplNameLen ) )
-        {
-            pRet = ::cppu::component_getFactoryHelper(
-                        pImplName, pServiceManager, pRegistryKey, entries);
-        }
 
         if( xFactory.is())
         {
@@ -136,4 +83,19 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL sw_component_getFactory(
 
 } // extern "C"
 
+extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
+SwXMailMerge_get_implementation(::com::sun::star::uno::XComponentContext*,
+                                ::com::sun::star::uno::Sequence<css::uno::Any> const &)
+{
+#if HAVE_FEATURE_DBCONNECTIVITY
+    SolarMutexGuard aGuard;
+
+    //the module may not be loaded
+    SwGlobals::ensure();
+    return cppu::acquire(new SwXMailMerge());
+#else
+    return nullptr;
+#endif
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/uno/unomailmerge.cxx b/sw/source/uibase/uno/unomailmerge.cxx
index 216a6c6..8564df6 100644
--- a/sw/source/uibase/uno/unomailmerge.cxx
+++ b/sw/source/uibase/uno/unomailmerge.cxx
@@ -1223,16 +1223,4 @@ OUString SAL_CALL SwXMailMerge_getImplementationName()
     return OUString( "SwXMailMerge" );
 }
 
-uno::Reference< uno::XInterface > SAL_CALL SwXMailMerge_createInstance(
-        const uno::Reference< XMultiServiceFactory > & /*rSMgr*/)
-    throw( uno::Exception )
-{
-    SolarMutexGuard aGuard;
-
-    //the module may not be loaded
-    SwGlobals::ensure();
-    uno::Reference< uno::XInterface > xRef = (cppu::OWeakObject *) new SwXMailMerge();
-    return xRef;
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/uno/unomod.cxx b/sw/source/uibase/uno/unomod.cxx
index 653cc8c..4e9009d 100644
--- a/sw/source/uibase/uno/unomod.cxx
+++ b/sw/source/uibase/uno/unomod.cxx
@@ -1002,4 +1002,11 @@ Sequence< OUString > SwXViewSettings::getSupportedServiceNames(void) throw( Runt
     return aRet;
 }
 
+extern "C" SAL_DLLPUBLIC_EXPORT ::com::sun::star::uno::XInterface* SAL_CALL
+SwXModule_get_implementation(::com::sun::star::uno::XComponentContext*,
+        ::com::sun::star::uno::Sequence<css::uno::Any> const &)
+{
+    return cppu::acquire(new SwXModule());
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/util/sw.component b/sw/util/sw.component
index 0b75e67..e89271f 100644
--- a/sw/util/sw.component
+++ b/sw/util/sw.component
@@ -18,17 +18,18 @@
  -->
 <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
     prefix="sw" xmlns="http://openoffice.org/2010/uno-components">
-  <implementation name="SwXAutoTextContainer">
+  <implementation name="SwXAutoTextContainer" constructor="SwXAutoTextContainer_get_implementation">
     <service name="com.sun.star.text.AutoTextContainer"/>
   </implementation>
-  <implementation name="SwXMailMerge">
+  <implementation name="SwXMailMerge" constructor="SwXMailMerge_get_implementation">
     <service name="com.sun.star.sdb.DataAccessDescriptor"/>
     <service name="com.sun.star.text.MailMerge"/>
   </implementation>
-  <implementation name="SwXModule">
+  <implementation name="SwXModule" constructor="SwXModule_get_implementation">
     <service name="com.sun.star.text.GlobalSettings"/>
   </implementation>
-  <implementation name="com.sun.star.comp.Writer.FilterOptionsDialog">
+  <implementation name="com.sun.star.comp.Writer.FilterOptionsDialog"
+      constructor="com_sun_star_comp_Writer_FilterOptionsDialog_get_implementation">
     <service name="com.sun.star.ui.dialogs.FilterOptionsDialog"/>
   </implementation>
   <implementation name="com.sun.star.comp.Writer.GlobalDocument"
@@ -105,10 +106,12 @@
       constructor="com_sun_star_comp_Writer_XMLStylesExporter_get_implementation">
     <service name="com.sun.star.comp.Writer.XMLStylesExporter"/>
   </implementation>
-  <implementation name="com.sun.star.util.comp.FinalThreadManager">
+  <implementation name="com.sun.star.util.comp.FinalThreadManager"
+      constructor="com_sun_star_util_comp_FinalThreadManager_get_implementation">
     <service name="com.sun.star.util.JobManager"/>
   </implementation>
-  <implementation name="com.sun.star.comp.Writer.LayoutDump">
+  <implementation name="com.sun.star.comp.Writer.LayoutDump"
+      constructor="com_sun_star_comp_Writer_LayoutDump_get_implementation">
     <service name="com.sun.star.comp.Writer.LayoutDump"/>
   </implementation>
   <implementation name="org.apache.openoffice.comp.sw.sidebar.SwPanelFactory"


More information about the Libreoffice-commits mailing list