Kaydet (Commit) d8cca1c3 authored tarafından Miklos Vajna's avatar Miklos Vajna

starmath: create XMLImporter instances with an uno constructor

Change-Id: I96623f6d87ec2f380b37a2de51a089e0a4d59136
Reviewed-on: https://gerrit.libreoffice.org/63134
Tested-by: Jenkins
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst 9d93e030
......@@ -278,6 +278,7 @@ edit_constructor_list = [
# starmath/util/sm.component
"Math_XMLOasisMetaExporter_get_implementation",
"Math_XMLOasisSettingsExporter_get_implementation",
"Math_XMLImporter_get_implementation",
# sw/util/sw.component
"com_sun_star_comp_Writer_XMLOasisContentExporter_get_implementation",
"com_sun_star_comp_Writer_XMLOasisMetaExporter_get_implementation",
......
......@@ -434,24 +434,14 @@ const uno::Sequence< sal_Int8 > & SmXMLImport::getUnoTunnelId() throw()
return theSmXMLImportUnoTunnelId::get().getSeq();
}
OUString SmXMLImport_getImplementationName() throw()
extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
Math_XMLImporter_get_implementation(uno::XComponentContext* pCtx,
uno::Sequence<uno::Any> const& /*rSeq*/)
{
return OUString( "com.sun.star.comp.Math.XMLImporter" );
return cppu::acquire(
new SmXMLImport(pCtx, "com.sun.star.comp.Math.XMLImporter", SvXMLImportFlags::ALL));
}
uno::Sequence< OUString > SmXMLImport_getSupportedServiceNames()
throw()
{
return uno::Sequence<OUString>{ IMPORT_SVC_NAME };
}
uno::Reference< uno::XInterface > SmXMLImport_createInstance(
const uno::Reference< lang::XMultiServiceFactory > & rSMgr)
{
return static_cast<cppu::OWeakObject*>(new SmXMLImport(comphelper::getComponentContext(rSMgr), SmXMLImport_getImplementationName(), SvXMLImportFlags::ALL));
}
OUString SmXMLImportMeta_getImplementationName() throw()
{
return OUString( "com.sun.star.comp.Math.XMLOasisMetaImporter" );
......
......@@ -46,14 +46,7 @@ SAL_DLLPUBLIC_EXPORT void* sm_component_getFactory( const sal_Char* pImplementat
Reference< XSingleServiceFactory > xFactory ;
Reference< XMultiServiceFactory > xServiceManager( static_cast< XMultiServiceFactory* >( pServiceManager ) ) ;
if( SmXMLImport_getImplementationName().equalsAscii( pImplementationName ))
{
xFactory = ::cppu::createSingleFactory( xServiceManager,
SmXMLImport_getImplementationName(),
SmXMLImport_createInstance,
SmXMLImport_getSupportedServiceNames() );
}
else if( SmXMLImportMeta_getImplementationName().equalsAscii( pImplementationName ))
if( SmXMLImportMeta_getImplementationName().equalsAscii( pImplementationName ))
{
xFactory = ::cppu::createSingleFactory( xServiceManager,
SmXMLImportMeta_getImplementationName(),
......
......@@ -32,14 +32,6 @@ OUString
css::uno::Reference< css::uno::XInterface >
SmDocument_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr, SfxModelFlags _nCreationFlags);
//MathML import
css::uno::Sequence< OUString >
SmXMLImport_getSupportedServiceNames() throw();
OUString
SmXMLImport_getImplementationName() throw();
/// @throws css::uno::Exception
css::uno::Reference< css::uno::XInterface >
SmXMLImport_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr);
css::uno::Sequence< OUString >
SmXMLImportMeta_getSupportedServiceNames() throw();
OUString
......
......@@ -30,7 +30,8 @@
constructor="Math_XMLExporter_get_implementation">
<service name="com.sun.star.xml.XMLExportFilter"/>
</implementation>
<implementation name="com.sun.star.comp.Math.XMLImporter">
<implementation name="com.sun.star.comp.Math.XMLImporter"
constructor="Math_XMLImporter_get_implementation">
<service name="com.sun.star.xml.XMLImportFilter"/>
</implementation>
<implementation name="com.sun.star.comp.Math.XMLMetaExporter"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment