summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2018-11-15 22:49:07 +0100
committerMiklos Vajna <vmiklos@collabora.com>2018-11-16 09:05:53 +0100
commit84a0496de8300e4e7febb0f30862d8c5f9a1472e (patch)
tree05a342522c31b8e02ae7eeea3bb48836e3b5fefa /starmath
parentbbf5c85c2affa47fe0f6674dd0ee8ccc55446769 (diff)
starmath: create XMLOasisMetaImporter instances with an uno constructor
Change-Id: Ie48a779958a393b68dea613c3bcc17113165f065 Reviewed-on: https://gerrit.libreoffice.org/63443 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/mathmlimport.cxx20
-rw-r--r--starmath/source/register.cxx9
-rw-r--r--starmath/source/register.hxx7
-rw-r--r--starmath/util/sm.component3
4 files changed, 8 insertions, 31 deletions
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index d9f764344dc1..fcf3ebb21b48 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -442,24 +442,14 @@ Math_XMLImporter_get_implementation(uno::XComponentContext* pCtx,
new SmXMLImport(pCtx, "com.sun.star.comp.Math.XMLImporter", SvXMLImportFlags::ALL));
}
-OUString SmXMLImportMeta_getImplementationName() throw()
-{
- return OUString( "com.sun.star.comp.Math.XMLOasisMetaImporter" );
-}
-
-uno::Sequence< OUString > SmXMLImportMeta_getSupportedServiceNames()
-throw()
-{
- return uno::Sequence<OUString>{ IMPORT_SVC_NAME };
-}
-
-uno::Reference< uno::XInterface > SmXMLImportMeta_createInstance(
- const uno::Reference< lang::XMultiServiceFactory > & rSMgr)
+extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
+Math_XMLOasisMetaImporter_get_implementation(uno::XComponentContext* pCtx,
+ uno::Sequence<uno::Any> const& /*rSeq*/)
{
- return static_cast<cppu::OWeakObject*>(new SmXMLImport( comphelper::getComponentContext(rSMgr), SmXMLImportMeta_getImplementationName(), SvXMLImportFlags::META ));
+ return cppu::acquire(new SmXMLImport(pCtx, "com.sun.star.comp.Math.XMLOasisMetaImporter",
+ SvXMLImportFlags::META));
}
-
OUString SmXMLImportSettings_getImplementationName() throw()
{
return OUString( "com.sun.star.comp.Math.XMLOasisSettingsImporter" );
diff --git a/starmath/source/register.cxx b/starmath/source/register.cxx
index 683f5c589fa8..e3bfe9f79e5b 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( SmXMLImportMeta_getImplementationName().equalsAscii( pImplementationName ))
- {
- xFactory = ::cppu::createSingleFactory( xServiceManager,
- SmXMLImportMeta_getImplementationName(),
- SmXMLImportMeta_createInstance,
- SmXMLImportMeta_getSupportedServiceNames() );
- }
- else if( SmXMLImportSettings_getImplementationName().equalsAscii( pImplementationName ))
+ if (SmXMLImportSettings_getImplementationName().equalsAscii(pImplementationName))
{
xFactory = ::cppu::createSingleFactory( xServiceManager,
SmXMLImportSettings_getImplementationName(),
diff --git a/starmath/source/register.hxx b/starmath/source/register.hxx
index 04dea0bd0da0..cad881135d63 100644
--- a/starmath/source/register.hxx
+++ b/starmath/source/register.hxx
@@ -33,13 +33,6 @@ css::uno::Reference< css::uno::XInterface >
SmDocument_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr, SfxModelFlags _nCreationFlags);
css::uno::Sequence< OUString >
- SmXMLImportMeta_getSupportedServiceNames() throw();
-OUString
- SmXMLImportMeta_getImplementationName() throw();
-/// @throws css::uno::Exception
-css::uno::Reference< css::uno::XInterface >
- SmXMLImportMeta_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr);
-css::uno::Sequence< OUString >
SmXMLImportSettings_getSupportedServiceNames() throw();
OUString SmXMLImportSettings_getImplementationName() throw();
/// @throws css::uno::Exception
diff --git a/starmath/util/sm.component b/starmath/util/sm.component
index 9215aebaef3b..91b7f1994d30 100644
--- a/starmath/util/sm.component
+++ b/starmath/util/sm.component
@@ -42,7 +42,8 @@
constructor="Math_XMLOasisMetaExporter_get_implementation">
<service name="com.sun.star.xml.XMLExportFilter"/>
</implementation>
- <implementation name="com.sun.star.comp.Math.XMLOasisMetaImporter">
+ <implementation name="com.sun.star.comp.Math.XMLOasisMetaImporter"
+ constructor="Math_XMLOasisMetaImporter_get_implementation">
<service name="com.sun.star.xml.XMLImportFilter"/>
</implementation>
<implementation name="com.sun.star.comp.Math.XMLOasisSettingsExporter"