[Libreoffice-commits] core.git: solenv/bin sw/source sw/util

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Oct 19 06:15:38 UTC 2018


 solenv/bin/native-code.py          |    1 +
 sw/source/core/inc/unofreg.hxx     |    6 ------
 sw/source/uibase/uno/unofreg.cxx   |    8 --------
 sw/source/uibase/uno/unomodule.cxx |   23 +++++++----------------
 sw/util/sw.component               |    6 ++++--
 5 files changed, 12 insertions(+), 32 deletions(-)

New commits:
commit 95ed72a4cda2826f56d6ef08267ddc89b0422c04
Author:     Miklos Vajna <vmiklos at collabora.co.uk>
AuthorDate: Thu Oct 18 21:40:05 2018 +0200
Commit:     Miklos Vajna <vmiklos at collabora.co.uk>
CommitDate: Fri Oct 19 08:14:06 2018 +0200

    sw: create SwUnoModule instances with an uno constructor
    
    Change-Id: If05d773d6823833ef075484807bf427dcc2c1426
    Reviewed-on: https://gerrit.libreoffice.org/61955
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index d93d30c1951c..6cf298c20dc0 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -283,6 +283,7 @@ edit_constructor_list = [
     "com_sun_star_comp_Writer_XMLOasisMetaExporter_get_implementation",
     "com_sun_star_comp_Writer_XMLOasisSettingsExporter_get_implementation",
     "com_sun_star_comp_Writer_XMLOasisStylesExporter_get_implementation",
+    "com_sun_star_comp_Writer_WriterModule_get_implementation",
     ]
 
 # math
diff --git a/sw/source/core/inc/unofreg.hxx b/sw/source/core/inc/unofreg.hxx
index cbfd140d25e7..e8d99c1a5be3 100644
--- a/sw/source/core/inc/unofreg.hxx
+++ b/sw/source/core/inc/unofreg.hxx
@@ -30,12 +30,6 @@ namespace com { namespace sun { namespace star { namespace lang {
     class XMultiServiceFactory;
 } } } }
 
-// module
-css::uno::Sequence< OUString > SwUnoModule_getSupportedServiceNames() throw();
-OUString SwUnoModule_getImplementationName() throw();
-/// @throws css::uno::Exception
-css::uno::Reference< css::uno::XInterface > SwUnoModule_createInstance( const css::uno::Reference< css::lang::XMultiServiceFactory > &rSMgr );
-
 // writer documents
 css::uno::Sequence< OUString > SwTextDocument_getSupportedServiceNames() throw();
 OUString SwTextDocument_getImplementationName() throw();
diff --git a/sw/source/uibase/uno/unofreg.cxx b/sw/source/uibase/uno/unofreg.cxx
index 3d2b0b91683f..74620c241033 100644
--- a/sw/source/uibase/uno/unofreg.cxx
+++ b/sw/source/uibase/uno/unofreg.cxx
@@ -62,14 +62,6 @@ SAL_DLLPUBLIC_EXPORT void * sw_component_getFactory(
                 SwTextDocument_createInstance,
                 SwTextDocument_getSupportedServiceNames() );
         }
-        else if( SwUnoModule_getImplementationName().equalsAsciiL(
-                                                    pImplName, nImplNameLen ) )
-        {
-            xFactory = ::cppu::createSingleFactory( xMSF,
-                SwUnoModule_getImplementationName(),
-                SwUnoModule_createInstance,
-                SwUnoModule_getSupportedServiceNames() );
-        }
 
         if( xFactory.is())
         {
diff --git a/sw/source/uibase/uno/unomodule.cxx b/sw/source/uibase/uno/unomodule.cxx
index b7e99dcf12b4..a3cccd5c7d8c 100644
--- a/sw/source/uibase/uno/unomodule.cxx
+++ b/sw/source/uibase/uno/unomodule.cxx
@@ -32,22 +32,12 @@
 
 using namespace css;
 
-OUString SwUnoModule_getImplementationName() throw()
-{
-    return OUString( "com.sun.star.comp.Writer.WriterModule" );
-}
-
-uno::Sequence< OUString > SwUnoModule_getSupportedServiceNames() throw()
-{
-    uno::Sequence<OUString> aSeq { "com.sun.star.text.ModuleDispatcher" };
-    return aSeq;
-}
-
-uno::Reference< uno::XInterface > SwUnoModule_createInstance(
-                const uno::Reference< lang::XMultiServiceFactory > &  )
+extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
+com_sun_star_comp_Writer_WriterModule_get_implementation(uno::XComponentContext* /*pCtx*/,
+                                                         uno::Sequence<uno::Any> const& /*rSeq*/)
 {
     SolarMutexGuard aGuard;
-    return uno::Reference< uno::XInterface >( dynamic_cast< frame::XDispatch * >(new SwUnoModule), uno::UNO_QUERY );
+    return cppu::acquire(new SwUnoModule);
 }
 
     // XNotifyingDispatch
@@ -144,7 +134,7 @@ uno::Reference< frame::XDispatch > SAL_CALL SwUnoModule::queryDispatch(
 // XServiceInfo
 OUString SAL_CALL SwUnoModule::getImplementationName(  )
 {
-    return SwUnoModule_getImplementationName();
+    return OUString( "com.sun.star.comp.Writer.WriterModule" );
 }
 
 sal_Bool SAL_CALL SwUnoModule::supportsService( const OUString& sServiceName )
@@ -154,7 +144,8 @@ sal_Bool SAL_CALL SwUnoModule::supportsService( const OUString& sServiceName )
 
 uno::Sequence< OUString > SAL_CALL SwUnoModule::getSupportedServiceNames(  )
 {
-    return SwUnoModule_getSupportedServiceNames();
+    uno::Sequence<OUString> aSeq { "com.sun.star.text.ModuleDispatcher" };
+    return aSeq;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/util/sw.component b/sw/util/sw.component
index 1bbc6766d913..ef96a6943230 100644
--- a/sw/util/sw.component
+++ b/sw/util/sw.component
@@ -47,7 +47,8 @@
       constructor="lo_writer_MMExcludeEntryController_get_implementation">
     <service name="com.sun.star.frame.ToolbarController"/>
   </implementation>
-  <implementation name="SwXModule" constructor="SwXModule_get_implementation">
+  <implementation name="SwXModule"
+      constructor="SwXModule_get_implementation">
     <service name="com.sun.star.text.GlobalSettings"/>
   </implementation>
   <implementation name="com.sun.star.comp.Writer.FilterOptionsDialog"
@@ -65,7 +66,8 @@
       constructor="com_sun_star_comp_Writer_WebDocument_get_implementation">
     <service name="com.sun.star.text.WebDocument"/>
   </implementation>
-  <implementation name="com.sun.star.comp.Writer.WriterModule">
+  <implementation name="com.sun.star.comp.Writer.WriterModule"
+      constructor="com_sun_star_comp_Writer_WriterModule_get_implementation">
     <service name="com.sun.star.text.ModuleDispatcher"/>
   </implementation>
   <implementation name="com.sun.star.comp.Writer.XMLContentExporter"


More information about the Libreoffice-commits mailing list