diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2018-11-15 22:49:07 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2018-11-16 09:05:53 +0100 |
commit | 84a0496de8300e4e7febb0f30862d8c5f9a1472e (patch) | |
tree | 05a342522c31b8e02ae7eeea3bb48836e3b5fefa /starmath | |
parent | bbf5c85c2affa47fe0f6674dd0ee8ccc55446769 (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.cxx | 20 | ||||
-rw-r--r-- | starmath/source/register.cxx | 9 | ||||
-rw-r--r-- | starmath/source/register.hxx | 7 | ||||
-rw-r--r-- | starmath/util/sm.component | 3 |
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" |