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

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Fri Jun 5 07:11:45 UTC 2020


 solenv/bin/native-code.py                     |    1 +
 xmloff/inc/facreg.hxx                         |    7 -------
 xmloff/source/core/facreg.cxx                 |    5 ++---
 xmloff/source/text/XMLAutoTextEventImport.cxx |   21 ++++-----------------
 xmloff/util/xo.component                      |    3 ++-
 5 files changed, 9 insertions(+), 28 deletions(-)

New commits:
commit c4bdc37e1a3cc6dea7688057bb33f56c2d6742c3
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Thu Jun 4 21:13:51 2020 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Fri Jun 5 09:11:05 2020 +0200

    xmloff: create XMLAutoTextEventImport instances with an uno constructor
    
    See tdf#74608 for motivation.
    
    Change-Id: I24f64c9ebc2c86a574f3a76f1e739f61bc458dc7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95536
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index db44ea3c1a51..ce4fcdec6d1f 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -338,6 +338,7 @@ core_constructor_list = [
     "com_sun_star_comp_Chart_XMLOasisContentImporter_get_implementation",
     "com_sun_star_comp_Chart_XMLOasisExporter_get_implementation",
     "com_sun_star_comp_Writer_XMLOasisAutotextEventsExporter_get_implementation",
+    "com_sun_star_comp_Writer_XMLOasisAutotextEventsImporter_get_implementation",
 # xmlscript/util/xmlscript.component
     "com_sun_star_comp_xmlscript_XMLBasicExporter",
     "com_sun_star_comp_xmlscript_XMLOasisBasicExporter",
diff --git a/xmloff/inc/facreg.hxx b/xmloff/inc/facreg.hxx
index 82d5d3e73b59..2a98fb344721 100644
--- a/xmloff/inc/facreg.hxx
+++ b/xmloff/inc/facreg.hxx
@@ -31,13 +31,6 @@ namespace com::sun::star {
     namespace uno { class XInterface; }
 }
 
-// writer autotext event import
-OUString XMLAutoTextEventImport_getImplementationName() throw();
-css::uno::Sequence<OUString> XMLAutoTextEventImport_getSupportedServiceNames() throw();
-/// @throws css::uno::Exception
-css::uno::Reference<css::uno::XInterface> XMLAutoTextEventImport_createInstance(
-    css::uno::Reference<css::lang::XMultiServiceFactory> const & rSMgr);
-
 // writer autotext event export OOo
 OUString XMLAutoTextEventExportOOO_getImplementationName() throw();
 css::uno::Sequence<OUString> XMLAutoTextEventExportOOO_getSupportedServiceNames() throw();
diff --git a/xmloff/source/core/facreg.cxx b/xmloff/source/core/facreg.cxx
index 377f05204c1a..cdc52d6c6a6e 100644
--- a/xmloff/source/core/facreg.cxx
+++ b/xmloff/source/core/facreg.cxx
@@ -54,9 +54,8 @@ XMLOFF_DLLPUBLIC void * xo_component_getFactory( const char * pImplName, void *
 
         const sal_Int32 nImplNameLen = strlen( pImplName );
 
-        // auto text import/export
-        SINGLEFACTORY( XMLAutoTextEventImport )
-        else SINGLEFACTORY( XMLAutoTextEventExportOOO )
+        // auto text export
+        SINGLEFACTORY( XMLAutoTextEventExportOOO )
 
         if( xFactory.is())
         {
diff --git a/xmloff/source/text/XMLAutoTextEventImport.cxx b/xmloff/source/text/XMLAutoTextEventImport.cxx
index 9f74c41ce1b1..bf6b9af0118d 100644
--- a/xmloff/source/text/XMLAutoTextEventImport.cxx
+++ b/xmloff/source/text/XMLAutoTextEventImport.cxx
@@ -91,24 +91,11 @@ SvXMLImportContext* XMLAutoTextEventImport::CreateFastContext(
     return nullptr;
 }
 
-
-Sequence< OUString >
-    XMLAutoTextEventImport_getSupportedServiceNames()
-        throw()
-{
-    Sequence<OUString> aSeq { XMLAutoTextEventImport_getImplementationName() };
-    return aSeq;
-}
-
-OUString XMLAutoTextEventImport_getImplementationName() throw()
-{
-    return "com.sun.star.comp.Writer.XMLOasisAutotextEventsImporter";
-}
-
-Reference< XInterface > XMLAutoTextEventImport_createInstance(
-        const Reference< XMultiServiceFactory > & rSMgr)
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+com_sun_star_comp_Writer_XMLOasisAutotextEventsImporter_get_implementation(
+    css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
 {
-    return static_cast<cppu::OWeakObject*>(new XMLAutoTextEventImport( comphelper::getComponentContext(rSMgr) ));
+    return cppu::acquire(new XMLAutoTextEventImport(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/util/xo.component b/xmloff/util/xo.component
index 0219cc5328ad..2e43c129673d 100644
--- a/xmloff/util/xo.component
+++ b/xmloff/util/xo.component
@@ -216,7 +216,8 @@
     <service name="com.sun.star.comp.Writer.XMLOasisAutotextEventsExporter"/>
   </implementation>
   <implementation
-      name="com.sun.star.comp.Writer.XMLOasisAutotextEventsImporter">
+      name="com.sun.star.comp.Writer.XMLOasisAutotextEventsImporter"
+      constructor="com_sun_star_comp_Writer_XMLOasisAutotextEventsImporter_get_implementation">
     <service name="com.sun.star.comp.Writer.XMLOasisAutotextEventsImporter"/>
   </implementation>
   <implementation name="xmloff::AnimationsImport"


More information about the Libreoffice-commits mailing list