summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-11-08 21:12:34 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-11-09 08:42:02 +0100
commitd8cca1c3720e3c3d352e68ecd0dbe8bfbbaf1e4e (patch)
tree056d5b51eee03845e0b80db9aa61a5ca2651a800 /starmath
parent9d93e030288aaa721761cb7991d1afdde6335777 (diff)
starmath: create XMLImporter instances with an uno constructor
Change-Id: I96623f6d87ec2f380b37a2de51a089e0a4d59136 Reviewed-on: https://gerrit.libreoffice.org/63134 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/mathmlimport.cxx20
-rw-r--r--starmath/source/register.cxx9
-rw-r--r--starmath/source/register.hxx8
-rw-r--r--starmath/util/sm.component3
4 files changed, 8 insertions, 32 deletions
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index 4cf6eb321f00..d9f764344dc1 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -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" );
diff --git a/starmath/source/register.cxx b/starmath/source/register.cxx
index e99038c3acb6..683f5c589fa8 100644
--- a/starmath/source/register.cxx
+++ b/starmath/source/register.cxx
@@ -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(),
diff --git a/starmath/source/register.hxx b/starmath/source/register.hxx
index cf6bac038eb7..04dea0bd0da0 100644
--- a/starmath/source/register.hxx
+++ b/starmath/source/register.hxx
@@ -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
diff --git a/starmath/util/sm.component b/starmath/util/sm.component
index 0c2af2021672..9215aebaef3b 100644
--- a/starmath/util/sm.component
+++ b/starmath/util/sm.component
@@ -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"