[Libreoffice-commits] core.git: solenv/bin starmath/source starmath/util
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Nov 9 07:43:55 UTC 2018
solenv/bin/native-code.py | 1 +
starmath/source/mathmlimport.cxx | 20 +++++---------------
starmath/source/register.cxx | 9 +--------
starmath/source/register.hxx | 8 --------
starmath/util/sm.component | 3 ++-
5 files changed, 9 insertions(+), 32 deletions(-)
New commits:
commit d8cca1c3720e3c3d352e68ecd0dbe8bfbbaf1e4e
Author: Miklos Vajna <vmiklos at collabora.co.uk>
AuthorDate: Thu Nov 8 21:12:34 2018 +0100
Commit: Miklos Vajna <vmiklos at collabora.co.uk>
CommitDate: Fri Nov 9 08:42:02 2018 +0100
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 at collabora.co.uk>
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 899baa5ff979..ebdba44a6aba 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -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",
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"
More information about the Libreoffice-commits
mailing list