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

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Fri Feb 28 07:17:00 UTC 2020


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

New commits:
commit c07c8567ea81aa98c587d1b327b53836c30e1809
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Thu Feb 27 21:09:52 2020 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Fri Feb 28 08:16:29 2020 +0100

    xmloff: create SchXMLImport_Styles instances with an uno constructor
    
    See tdf#74608 for motivation.
    
    Change-Id: I517ee5a3b22ea90cbbd1eb82f08b69b2964898a9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89649
    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 cf450c540624..e09962dabeb7 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -320,6 +320,7 @@ core_constructor_list = [
     "com_sun_star_comp_Impress_XMLClipboardExporter_get_implementation",
     "com_sun_star_comp_Chart_XMLOasisImporter_get_implementation",
     "com_sun_star_comp_Chart_XMLOasisMetaImporter_get_implementation",
+    "com_sun_star_comp_Chart_XMLOasisStylesImporter_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 0dd5f1392d41..6111b0478172 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_Styles_getImplementationName() throw();
-css::uno::Sequence<OUString> SchXMLImport_Styles_getSupportedServiceNames() throw();
-/// @throws css::uno::Exception
-css::uno::Reference<css::uno::XInterface> SchXMLImport_Styles_createInstance(
-    css::uno::Reference<css::lang::XMultiServiceFactory> const & rSMgr);
 OUString SchXMLImport_Content_getImplementationName() throw();
 css::uno::Sequence<OUString> SchXMLImport_Content_getSupportedServiceNames() throw();
 /// @throws css::uno::Exception
diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx
index 1187fd35c804..42a7e0fc8882 100644
--- a/xmloff/source/chart/SchXMLImport.cxx
+++ b/xmloff/source/chart/SchXMLImport.cxx
@@ -591,21 +591,6 @@ com_sun_star_comp_Chart_XMLOasisImporter_get_implementation(uno::XComponentConte
 
 // multiple storage version: one for content / styles / meta
 
-Sequence< OUString > SchXMLImport_Styles_getSupportedServiceNames() throw()
-{
-    return Sequence< OUString > { "com.sun.star.comp.Chart.XMLOasisStylesImporter" };
-}
-
-OUString SchXMLImport_Styles_getImplementationName() throw()
-{
-    return "SchXMLImport.Styles";
-}
-
-Reference< uno::XInterface > SchXMLImport_Styles_createInstance(const Reference< lang::XMultiServiceFactory > & rSMgr)
-{
-    return static_cast<cppu::OWeakObject*>(new SchXMLImport( comphelper::getComponentContext(rSMgr), SchXMLImport_Styles_getImplementationName(), SvXMLImportFlags::STYLES ));
-}
-
 Sequence< OUString > SchXMLImport_Content_getSupportedServiceNames() throw()
 {
     return Sequence< OUString > { "com.sun.star.comp.Chart.XMLOasisContentImporter" };
@@ -628,4 +613,11 @@ com_sun_star_comp_Chart_XMLOasisMetaImporter_get_implementation(
     return cppu::acquire(new SchXMLImport(pCtx, "SchXMLImport.Meta", SvXMLImportFlags::META));
 }
 
+extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
+com_sun_star_comp_Chart_XMLOasisStylesImporter_get_implementation(
+    uno::XComponentContext* pCtx, uno::Sequence<uno::Any> const& /*rSeq*/)
+{
+    return cppu::acquire(new SchXMLImport(pCtx, "SchXMLImport.Styles", SvXMLImportFlags::STYLES));
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/core/facreg.cxx b/xmloff/source/core/facreg.cxx
index fee9e1c431e7..9e7602c32853 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_Styles )
-        else SINGLEFACTORY( SchXMLImport_Content )
+        SINGLEFACTORY( SchXMLImport_Content )
 
         // chart oasis export
         else SINGLEFACTORY( SchXMLExport_Oasis )
diff --git a/xmloff/util/xo.component b/xmloff/util/xo.component
index 272e6d22ff12..28c57096779e 100644
--- a/xmloff/util/xo.component
+++ b/xmloff/util/xo.component
@@ -51,7 +51,8 @@
       constructor="com_sun_star_comp_Chart_XMLOasisMetaImporter_get_implementation">
     <service name="com.sun.star.comp.Chart.XMLOasisMetaImporter"/>
   </implementation>
-  <implementation name="SchXMLImport.Styles">
+  <implementation name="SchXMLImport.Styles"
+      constructor="com_sun_star_comp_Chart_XMLOasisStylesImporter_get_implementation">
     <service name="com.sun.star.comp.Chart.XMLOasisStylesImporter"/>
   </implementation>
   <implementation name="XMLDrawContentExportOOO"


More information about the Libreoffice-commits mailing list