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

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Fri Feb 21 07:41:15 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 2b64e3e9a9010b10ecf374903f377a5bb9c0cbe5
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Thu Feb 20 21:12:05 2020 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Fri Feb 21 08:40:38 2020 +0100

    xmloff: create SchXMLImport_Meta instances with an uno constructor
    
    See tdf#74608 for motivation.
    
    Change-Id: I7f783161c190940b10d9acd971a008c17f4f7dbc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89158
    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 63802e5c5528..c85b4b197a43 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -319,6 +319,7 @@ core_constructor_list = [
     "com_sun_star_comp_DrawingLayer_XMLExporter_get_implementation",
     "com_sun_star_comp_Impress_XMLClipboardExporter_get_implementation",
     "com_sun_star_comp_Chart_XMLOasisImporter_get_implementation",
+    "com_sun_star_comp_Chart_XMLOasisMetaImporter_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 aed6215198a0..0dd5f1392d41 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_Meta_getImplementationName() throw();
-css::uno::Sequence<OUString> SchXMLImport_Meta_getSupportedServiceNames() throw();
-/// @throws css::uno::Exception
-css::uno::Reference<css::uno::XInterface> SchXMLImport_Meta_createInstance(
-    css::uno::Reference<css::lang::XMultiServiceFactory> const & rSMgr);
 OUString SchXMLImport_Styles_getImplementationName() throw();
 css::uno::Sequence<OUString> SchXMLImport_Styles_getSupportedServiceNames() throw();
 /// @throws css::uno::Exception
diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx
index 25cf41deb021..1187fd35c804 100644
--- a/xmloff/source/chart/SchXMLImport.cxx
+++ b/xmloff/source/chart/SchXMLImport.cxx
@@ -621,19 +621,11 @@ Reference< uno::XInterface > SchXMLImport_Content_createInstance(const Reference
     return static_cast<cppu::OWeakObject*>(new SchXMLImport( comphelper::getComponentContext(rSMgr), SchXMLImport_Content_getImplementationName(), SvXMLImportFlags::CONTENT | SvXMLImportFlags::AUTOSTYLES | SvXMLImportFlags::FONTDECLS ));
 }
 
-Sequence< OUString > SchXMLImport_Meta_getSupportedServiceNames() throw()
-{
-    return Sequence< OUString > { "com.sun.star.comp.Chart.XMLOasisMetaImporter" };
-}
-
-OUString SchXMLImport_Meta_getImplementationName() throw()
-{
-    return "SchXMLImport.Meta";
-}
-
-Reference< uno::XInterface > SchXMLImport_Meta_createInstance(const Reference< lang::XMultiServiceFactory > & rSMgr)
+extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
+com_sun_star_comp_Chart_XMLOasisMetaImporter_get_implementation(
+    uno::XComponentContext* pCtx, uno::Sequence<uno::Any> const& /*rSeq*/)
 {
-    return static_cast<cppu::OWeakObject*>(new SchXMLImport( comphelper::getComponentContext(rSMgr), SchXMLImport_Meta_getImplementationName(), SvXMLImportFlags::META ));
+    return cppu::acquire(new SchXMLImport(pCtx, "SchXMLImport.Meta", SvXMLImportFlags::META));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/core/facreg.cxx b/xmloff/source/core/facreg.cxx
index 2326a0a1a446..fee9e1c431e7 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_Meta )
-        else SINGLEFACTORY( SchXMLImport_Styles )
+        SINGLEFACTORY( SchXMLImport_Styles )
         else SINGLEFACTORY( SchXMLImport_Content )
 
         // chart oasis export
diff --git a/xmloff/util/xo.component b/xmloff/util/xo.component
index c4caa340c594..272e6d22ff12 100644
--- a/xmloff/util/xo.component
+++ b/xmloff/util/xo.component
@@ -47,7 +47,8 @@
   <implementation name="SchXMLImport.Content">
     <service name="com.sun.star.comp.Chart.XMLOasisContentImporter"/>
   </implementation>
-  <implementation name="SchXMLImport.Meta">
+  <implementation name="SchXMLImport.Meta"
+      constructor="com_sun_star_comp_Chart_XMLOasisMetaImporter_get_implementation">
     <service name="com.sun.star.comp.Chart.XMLOasisMetaImporter"/>
   </implementation>
   <implementation name="SchXMLImport.Styles">


More information about the Libreoffice-commits mailing list