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

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Fri Jan 24 07:50:52 UTC 2020


 solenv/bin/native-code.py       |    1 +
 xmloff/inc/facreg.hxx           |    7 -------
 xmloff/source/core/facreg.cxx   |    5 +----
 xmloff/source/draw/sdxmlexp.cxx |   25 ++++++++++---------------
 xmloff/util/xo.component        |    3 ++-
 5 files changed, 14 insertions(+), 27 deletions(-)

New commits:
commit e975ab34daf72a2b708a46095994d0df3c23dec0
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Thu Jan 23 21:11:24 2020 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Fri Jan 24 08:50:18 2020 +0100

    xmloff: create XMLImpressClipboardExport instances with an uno constructor
    
    See tdf#74608 for motivation.
    
    Change-Id: Idab3996986eb38ff8b1a3765f9bf005229271728
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87294
    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 13a4ff709825..692173df04d2 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -311,6 +311,7 @@ core_constructor_list = [
     "com_sun_star_comp_Draw_XMLOasisSettingsImporter_get_implementation",
     "com_sun_star_comp_Xmloff_AnimationsImport",
     "com_sun_star_comp_DrawingLayer_XMLExporter_get_implementation",
+    "com_sun_star_comp_Impress_XMLClipboardExporter_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 589210d9e8c8..3b99c7b284d6 100644
--- a/xmloff/inc/facreg.hxx
+++ b/xmloff/inc/facreg.hxx
@@ -31,13 +31,6 @@ namespace com { namespace sun { namespace star {
     namespace uno { class XInterface; }
 } } }
 
-// impress xml clipboard export
-OUString XMLImpressClipboardExport_getImplementationName() throw();
-css::uno::Sequence<OUString> XMLImpressClipboardExport_getSupportedServiceNames() throw();
-/// @throws css::uno::Exception
-css::uno::Reference<css::uno::XInterface> XMLImpressClipboardExport_createInstance(
-    css::uno::Reference<css::lang::XMultiServiceFactory> const & rSMgr);
-
 // chart oasis import
 OUString SchXMLImport_getImplementationName() throw();
 css::uno::Sequence<OUString> SchXMLImport_getSupportedServiceNames() throw();
diff --git a/xmloff/source/core/facreg.cxx b/xmloff/source/core/facreg.cxx
index 0a1357d93f76..83451967711e 100644
--- a/xmloff/source/core/facreg.cxx
+++ b/xmloff/source/core/facreg.cxx
@@ -54,11 +54,8 @@ XMLOFF_DLLPUBLIC void * xo_component_getFactory( const char * pImplName, void *
 
         const sal_Int32 nImplNameLen = strlen( pImplName );
 
-        // impress xml clipboard export
-        SINGLEFACTORY( XMLImpressClipboardExport )
-
         // chart oasis import
-        else SINGLEFACTORY( SchXMLImport )
+        SINGLEFACTORY( SchXMLImport )
         else SINGLEFACTORY( SchXMLImport_Meta )
         else SINGLEFACTORY( SchXMLImport_Styles )
         else SINGLEFACTORY( SchXMLImport_Content )
diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx
index 3fd9320c58bb..9471c10db1f7 100644
--- a/xmloff/source/draw/sdxmlexp.cxx
+++ b/xmloff/source/draw/sdxmlexp.cxx
@@ -2578,20 +2578,6 @@ void SdXMLExport::exportAnnotations( const Reference<XDrawPage>& xDrawPage )
     }
 }
 
-#define SERVICE( classname, servicename, implementationname, draw, flags )\
-uno::Sequence< OUString > classname##_getSupportedServiceNames() throw()\
-{\
-    return uno::Sequence< OUString > { servicename };\
-}\
-OUString classname##_getImplementationName() throw()\
-{\
-    return implementationname;\
-}\
-uno::Reference< uno::XInterface > classname##_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr)\
-{\
-    return static_cast<cppu::OWeakObject*>(new SdXMLExport( comphelper::getComponentContext(rSMgr), implementationname, draw, flags )); \
-}
-
 extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
 com_sun_star_comp_Impress_XMLOasisExporter_get_implementation(
     uno::XComponentContext* pCtx, uno::Sequence<uno::Any> const& /*rSeq*/)
@@ -2795,7 +2781,16 @@ com_sun_star_comp_DrawingLayer_XMLExporter_get_implementation(
                             | SvXMLExportFlags::FONTDECLS | SvXMLExportFlags::EMBEDDED));
 }
 
-SERVICE( XMLImpressClipboardExport, "com.sun.star.comp.Impress.XMLClipboardExporter", "XMLImpressClipboardExport", false, SvXMLExportFlags::OASIS|SvXMLExportFlags::STYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::EMBEDDED );
+extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
+com_sun_star_comp_Impress_XMLClipboardExporter_get_implementation(
+    uno::XComponentContext* pCtx, uno::Sequence<uno::Any> const& /*rSeq*/)
+{
+    return cppu::acquire(
+        new SdXMLExport(pCtx, "XMLImpressClipboardExport", /*bIsDraw=*/false,
+                        SvXMLExportFlags::OASIS | SvXMLExportFlags::STYLES
+                            | SvXMLExportFlags::AUTOSTYLES | SvXMLExportFlags::CONTENT
+                            | SvXMLExportFlags::FONTDECLS | SvXMLExportFlags::EMBEDDED));
+}
 
 XMLFontAutoStylePool* SdXMLExport::CreateFontAutoStylePool()
 {
diff --git a/xmloff/util/xo.component b/xmloff/util/xo.component
index 57b160bd2719..a5dd39f732a6 100644
--- a/xmloff/util/xo.component
+++ b/xmloff/util/xo.component
@@ -100,7 +100,8 @@
     constructor="com_sun_star_comp_DrawingLayer_XMLExporter_get_implementation">
     <service name="com.sun.star.comp.DrawingLayer.XMLExporter"/>
   </implementation>
-  <implementation name="XMLImpressClipboardExport">
+  <implementation name="XMLImpressClipboardExport"
+    constructor="com_sun_star_comp_Impress_XMLClipboardExporter_get_implementation">
     <service name="com.sun.star.comp.Impress.XMLClipboardExporter"/>
   </implementation>
   <implementation name="XMLImpressContentExportOOO"


More information about the Libreoffice-commits mailing list