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>
This commit is contained in:
Miklos Vajna 2020-01-09 21:06:23 +01:00
parent 90cab308f5
commit 6996fc1741
5 changed files with 10 additions and 24 deletions

View file

@ -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",

View file

@ -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();

View file

@ -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 )

View file

@ -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: */

View file

@ -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>