From 6996fc174121b80a0eb1079621fd766fab95117e Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Thu, 9 Jan 2020 21:06:23 +0100 Subject: 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 --- xmloff/inc/facreg.hxx | 7 ------- xmloff/source/core/facreg.cxx | 4 +--- xmloff/source/draw/animationimport.cxx | 19 ++++++------------- xmloff/util/xo.component | 3 ++- 4 files changed, 9 insertions(+), 24 deletions(-) (limited to 'xmloff') 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 AnimationsImport_getSupportedServiceNames() throw(); -/// @throws css::uno::Exception -css::uno::Reference AnimationsImport_createInstance( - css::uno::Reference const & rSMgr); - // drawing layer export OUString XMLDrawingLayerExport_getImplementationName() throw(); css::uno::Sequence 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 const& /*rSeq*/) { - return static_cast(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"> - + -- cgit