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

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Fri Feb 14 08:14:06 UTC 2020


 solenv/bin/native-code.py            |    1 +
 xmloff/inc/facreg.hxx                |    5 -----
 xmloff/source/chart/SchXMLImport.cxx |   16 ++++------------
 xmloff/source/core/facreg.cxx        |    3 +--
 xmloff/util/xo.component             |    3 ++-
 5 files changed, 8 insertions(+), 20 deletions(-)

New commits:
commit 26df9f97bfcd3cbc071dde1dc5cba1703c04f1f9
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Thu Feb 13 21:03:42 2020 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Fri Feb 14 09:13:34 2020 +0100

    xmloff: create SchXMLImport instances with an uno constructor
    
    See tdf#74608 for motivation.
    
    Change-Id: I6b4a78317e2b228296c8e4794c776b617920ccfd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88630
    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 032eb59a576c..63802e5c5528 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -318,6 +318,7 @@ core_constructor_list = [
     "com_sun_star_comp_Xmloff_AnimationsImport",
     "com_sun_star_comp_DrawingLayer_XMLExporter_get_implementation",
     "com_sun_star_comp_Impress_XMLClipboardExporter_get_implementation",
+    "com_sun_star_comp_Chart_XMLOasisImporter_get_implementation",
 # xmlscript/util/xmlscript.component
     "com_sun_star_comp_xmlscript_XMLBasicExporter",
     "com_sun_star_comp_xmlscript_XMLBasicImporter",
diff --git a/xmloff/inc/facreg.hxx b/xmloff/inc/facreg.hxx
index 3b99c7b284d6..aed6215198a0 100644
--- a/xmloff/inc/facreg.hxx
+++ b/xmloff/inc/facreg.hxx
@@ -32,11 +32,6 @@ namespace com { namespace sun { namespace star {
 } } }
 
 // chart oasis import
-OUString SchXMLImport_getImplementationName() throw();
-css::uno::Sequence<OUString> SchXMLImport_getSupportedServiceNames() throw();
-/// @throws css::uno::Exception
-css::uno::Reference<css::uno::XInterface> SchXMLImport_createInstance(
-    css::uno::Reference<css::lang::XMultiServiceFactory> const & rSMgr);
 OUString SchXMLImport_Meta_getImplementationName() throw();
 css::uno::Sequence<OUString> SchXMLImport_Meta_getSupportedServiceNames() throw();
 /// @throws css::uno::Exception
diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx
index 354e4ae4cf85..25cf41deb021 100644
--- a/xmloff/source/chart/SchXMLImport.cxx
+++ b/xmloff/source/chart/SchXMLImport.cxx
@@ -582,19 +582,11 @@ void SAL_CALL SchXMLImport::setTargetDocument(const uno::Reference<lang::XCompon
 
 // first version: everything comes from one storage
 
-Sequence< OUString > SchXMLImport_getSupportedServiceNames() throw()
+extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
+com_sun_star_comp_Chart_XMLOasisImporter_get_implementation(uno::XComponentContext* pCtx,
+                                                            uno::Sequence<uno::Any> const& /*rSeq*/)
 {
-    return Sequence< OUString > { "com.sun.star.comp.Chart.XMLOasisImporter" };
-}
-
-OUString SchXMLImport_getImplementationName() throw()
-{
-    return "SchXMLImport";
-}
-
-Reference< uno::XInterface > SchXMLImport_createInstance(const Reference< lang::XMultiServiceFactory > & rSMgr)
-{
-    return static_cast<cppu::OWeakObject*>(new SchXMLImport( comphelper::getComponentContext(rSMgr), SchXMLImport_getImplementationName(), SvXMLImportFlags::ALL));
+    return cppu::acquire(new SchXMLImport(pCtx, "SchXMLImport", SvXMLImportFlags::ALL));
 }
 
 // multiple storage version: one for content / styles / meta
diff --git a/xmloff/source/core/facreg.cxx b/xmloff/source/core/facreg.cxx
index 83451967711e..2326a0a1a446 100644
--- a/xmloff/source/core/facreg.cxx
+++ b/xmloff/source/core/facreg.cxx
@@ -55,8 +55,7 @@ XMLOFF_DLLPUBLIC void * xo_component_getFactory( const char * pImplName, void *
         const sal_Int32 nImplNameLen = strlen( pImplName );
 
         // chart oasis import
-        SINGLEFACTORY( SchXMLImport )
-        else SINGLEFACTORY( SchXMLImport_Meta )
+        SINGLEFACTORY( SchXMLImport_Meta )
         else SINGLEFACTORY( SchXMLImport_Styles )
         else SINGLEFACTORY( SchXMLImport_Content )
 
diff --git a/xmloff/util/xo.component b/xmloff/util/xo.component
index a5dd39f732a6..c4caa340c594 100644
--- a/xmloff/util/xo.component
+++ b/xmloff/util/xo.component
@@ -40,7 +40,8 @@
   <implementation name="SchXMLExport.Styles">
     <service name="com.sun.star.comp.Chart.XMLStylesExporter"/>
   </implementation>
-  <implementation name="SchXMLImport">
+  <implementation name="SchXMLImport"
+      constructor="com_sun_star_comp_Chart_XMLOasisImporter_get_implementation">
     <service name="com.sun.star.comp.Chart.XMLOasisImporter"/>
   </implementation>
   <implementation name="SchXMLImport.Content">


More information about the Libreoffice-commits mailing list