summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-01-09 21:06:23 +0100
committerMiklos Vajna <vmiklos@collabora.com>2020-01-10 08:36:30 +0100
commit6996fc174121b80a0eb1079621fd766fab95117e (patch)
tree9413607802b6219408bc297ecb5ecf63e12d1f61 /xmloff
parent90cab308f52468edbf87a7f06a1ef99f146f03a5 (diff)
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@collabora.com>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/inc/facreg.hxx7
-rw-r--r--xmloff/source/core/facreg.cxx4
-rw-r--r--xmloff/source/draw/animationimport.cxx19
-rw-r--r--xmloff/util/xo.component3
4 files changed, 9 insertions, 24 deletions
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>