[Libreoffice-commits] core.git: solenv/bin starmath/source starmath/util
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Nov 30 07:37:30 UTC 2018
solenv/bin/native-code.py | 1 +
starmath/source/mathmlimport.cxx | 22 +++++-----------------
starmath/source/register.cxx | 9 +--------
starmath/source/register.hxx | 7 -------
starmath/util/sm.component | 3 ++-
5 files changed, 9 insertions(+), 33 deletions(-)
New commits:
commit f8325dd3ea14a4766cd2bb7c0249338b59c2ed28
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Thu Nov 29 21:34:51 2018 +0100
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Fri Nov 30 08:37:00 2018 +0100
starmath: create XMLOasisSettingsImporter instances with an uno constructor
Change-Id: I92c8991baf10fde574d06ab0870bbb26a7632e65
Reviewed-on: https://gerrit.libreoffice.org/64284
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 345ebb9a8e1f..c3cc2b1f0edb 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -281,6 +281,7 @@ edit_constructor_list = [
"Math_XMLOasisSettingsExporter_get_implementation",
"Math_XMLImporter_get_implementation",
"Math_XMLOasisMetaImporter_get_implementation",
+ "Math_XMLOasisSettingsImporter_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 fcf3ebb21b48..4db3dfef7fdf 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -79,9 +79,6 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star;
using namespace ::xmloff::token;
-
-#define IMPORT_SVC_NAME "com.sun.star.xml.XMLImportFilter"
-
namespace {
SmNode* popOrZero(SmNodeStack& rStack)
@@ -450,21 +447,12 @@ Math_XMLOasisMetaImporter_get_implementation(uno::XComponentContext* pCtx,
SvXMLImportFlags::META));
}
-OUString SmXMLImportSettings_getImplementationName() throw()
-{
- return OUString( "com.sun.star.comp.Math.XMLOasisSettingsImporter" );
-}
-
-uno::Sequence< OUString > SmXMLImportSettings_getSupportedServiceNames()
- throw()
-{
- return uno::Sequence<OUString>{ IMPORT_SVC_NAME };
-}
-
-uno::Reference< uno::XInterface > SmXMLImportSettings_createInstance(
- const uno::Reference< lang::XMultiServiceFactory > & rSMgr)
+extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
+Math_XMLOasisSettingsImporter_get_implementation(uno::XComponentContext* pCtx,
+ uno::Sequence<uno::Any> const& /*rSeq*/)
{
- return static_cast<cppu::OWeakObject*>(new SmXMLImport( comphelper::getComponentContext(rSMgr), SmXMLImportSettings_getImplementationName(), SvXMLImportFlags::SETTINGS ));
+ return cppu::acquire(new SmXMLImport(pCtx, "com.sun.star.comp.Math.XMLOasisSettingsImporter",
+ SvXMLImportFlags::SETTINGS));
}
sal_Int64 SAL_CALL SmXMLImport::getSomething(
diff --git a/starmath/source/register.cxx b/starmath/source/register.cxx
index e3bfe9f79e5b..3e06241484c3 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 (SmXMLImportSettings_getImplementationName().equalsAscii(pImplementationName))
- {
- xFactory = ::cppu::createSingleFactory( xServiceManager,
- SmXMLImportSettings_getImplementationName(),
- SmXMLImportSettings_createInstance,
- SmXMLImportSettings_getSupportedServiceNames() );
- }
- else if( SmDocument_getImplementationName().equalsAscii( pImplementationName ))
+ if (SmDocument_getImplementationName().equalsAscii(pImplementationName))
{
xFactory = ::sfx2::createSfxModelFactory( xServiceManager,
SmDocument_getImplementationName(),
diff --git a/starmath/source/register.hxx b/starmath/source/register.hxx
index cad881135d63..be875fbeccb0 100644
--- a/starmath/source/register.hxx
+++ b/starmath/source/register.hxx
@@ -32,13 +32,6 @@ OUString
css::uno::Reference< css::uno::XInterface >
SmDocument_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr, SfxModelFlags _nCreationFlags);
-css::uno::Sequence< OUString >
- SmXMLImportSettings_getSupportedServiceNames() throw();
-OUString SmXMLImportSettings_getImplementationName() throw();
-/// @throws css::uno::Exception
-css::uno::Reference< css::uno::XInterface >
- SmXMLImportSettings_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr);
-
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/starmath/util/sm.component b/starmath/util/sm.component
index 91b7f1994d30..775b41100a97 100644
--- a/starmath/util/sm.component
+++ b/starmath/util/sm.component
@@ -50,7 +50,8 @@
constructor="Math_XMLOasisSettingsExporter_get_implementation">
<service name="com.sun.star.xml.XMLExportFilter"/>
</implementation>
- <implementation name="com.sun.star.comp.Math.XMLOasisSettingsImporter">
+ <implementation name="com.sun.star.comp.Math.XMLOasisSettingsImporter"
+ constructor="Math_XMLOasisSettingsImporter_get_implementation">
<service name="com.sun.star.xml.XMLImportFilter"/>
</implementation>
<implementation name="com.sun.star.comp.Math.XMLSettingsExporter"
More information about the Libreoffice-commits
mailing list