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

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Fri Jan 10 07:37:02 UTC 2020


 solenv/bin/native-code.py              |    1 +
 xmloff/inc/facreg.hxx                  |    7 -------
 xmloff/source/core/facreg.cxx          |    4 +---
 xmloff/source/draw/animationimport.cxx |   19 ++++++-------------
 xmloff/util/xo.component               |    3 ++-
 5 files changed, 10 insertions(+), 24 deletions(-)

New commits:
commit 6996fc174121b80a0eb1079621fd766fab95117e
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Thu Jan 9 21:06:23 2020 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Fri Jan 10 08:36:30 2020 +0100

    xmloff: create AnimationsImport instances with an uno constructor
    
    See tdf#74608 for motivation.
    
    Change-Id: I36a70b0657c4648a9f5cf69d67d4da4508099587
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86503
    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 420219729e2c..3cdcf933f84a 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -309,6 +309,7 @@ core_constructor_list = [
     "com_sun_star_comp_Draw_XMLOasisContentImporter_get_implementation",
     "com_sun_star_comp_Draw_XMLOasisMetaImporter_get_implementation",
     "com_sun_star_comp_Draw_XMLOasisSettingsImporter_get_implementation",
+    "com_sun_star_comp_Xmloff_AnimationsImport",
 # 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 25b2334f0b1b..aea6ca9a23e4 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 animation import
-OUString AnimationsImport_getImplementationName() throw();
-css::uno::Sequence<OUString> AnimationsImport_getSupportedServiceNames() throw();
-/// @throws css::uno::Exception
-css::uno::Reference<css::uno::XInterface> AnimationsImport_createInstance(
-    css::uno::Reference<css::lang::XMultiServiceFactory> const & rSMgr);
-
 // drawing layer export
 OUString XMLDrawingLayerExport_getImplementationName() throw();
 css::uno::Sequence<OUString> XMLDrawingLayerExport_getSupportedServiceNames() throw();
diff --git a/xmloff/source/core/facreg.cxx b/xmloff/source/core/facreg.cxx
index 3233bb85a12f..cf214d3cdf33 100644
--- a/xmloff/source/core/facreg.cxx
+++ b/xmloff/source/core/facreg.cxx
@@ -54,10 +54,8 @@ XMLOFF_DLLPUBLIC void * xo_component_getFactory( const char * pImplName, void *
 
         const sal_Int32 nImplNameLen = strlen( pImplName );
 
-        SINGLEFACTORY( AnimationsImport )
-
         // drawing layer export
-        else SINGLEFACTORY( XMLDrawingLayerExport )
+        SINGLEFACTORY( XMLDrawingLayerExport )
 
         // impress xml clipboard export
         else SINGLEFACTORY( XMLImpressClipboardExport )
diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx
index fea0eac29ece..29df61897d53 100644
--- a/xmloff/source/draw/animationimport.cxx
+++ b/xmloff/source/draw/animationimport.cxx
@@ -70,6 +70,7 @@
 
 using namespace ::std;
 using namespace ::cppu;
+using namespace ::com::sun::star;
 using namespace ::com::sun::star::beans;
 using namespace ::com::sun::star::animations;
 using namespace ::com::sun::star::presentation;
@@ -87,16 +88,6 @@ using ::com::sun::star::container::XEnumeration;
 using ::com::sun::star::lang::XMultiServiceFactory;
 using ::com::sun::star::lang::XInitialization;
 
-Sequence< OUString > AnimationsImport_getSupportedServiceNames() throw()
-{
-    return Sequence< OUString > { "com.sun.star.comp.Xmloff.AnimationsImport" };
-}
-
-OUString AnimationsImport_getImplementationName() throw()
-{
-    return "xmloff::AnimationsImport";
-}
-
 static OUString
 lcl_GetMediaReference(SvXMLImport const& rImport, OUString const& rURL)
 {
@@ -1228,7 +1219,7 @@ private:
 }
 
 AnimationsImport::AnimationsImport( const Reference< XComponentContext > & rxContext )
-: SvXMLImport( rxContext, AnimationsImport_getImplementationName(), SvXMLImportFlags::META )
+: SvXMLImport( rxContext, "xmloff::AnimationsImport", SvXMLImportFlags::META )
     //FIXME: the above "IMPORT_META" used to be a nonsensical "true", question
     // remains whether this should be IMPORT_META (same numerical value as
     // true) or default IMPORT_ALL
@@ -1379,9 +1370,11 @@ void AnimationNodeContext::postProcessRootNode( const Reference< XAnimationNode
 
 } // namespace xmloff
 
-Reference< XInterface > AnimationsImport_createInstance(const Reference< XMultiServiceFactory > & rSMgr)
+extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
+com_sun_star_comp_Xmloff_AnimationsImport(uno::XComponentContext* pCtx,
+                                          uno::Sequence<uno::Any> const& /*rSeq*/)
 {
-    return static_cast<cppu::OWeakObject*>(new xmloff::AnimationsImport( comphelper::getComponentContext(rSMgr) ));
+    return cppu::acquire(new xmloff::AnimationsImport(pCtx));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/util/xo.component b/xmloff/util/xo.component
index eb218ca12d21..32e3bf12dc10 100644
--- a/xmloff/util/xo.component
+++ b/xmloff/util/xo.component
@@ -204,7 +204,8 @@
       name="com.sun.star.comp.Writer.XMLOasisAutotextEventsImporter">
     <service name="com.sun.star.comp.Writer.XMLOasisAutotextEventsImporter"/>
   </implementation>
-  <implementation name="xmloff::AnimationsImport">
+  <implementation name="xmloff::AnimationsImport"
+      constructor="com_sun_star_comp_Xmloff_AnimationsImport">
     <service name="com.sun.star.comp.Xmloff.AnimationsImport"/>
   </implementation>
 </component>


More information about the Libreoffice-commits mailing list