summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-05-28 21:06:17 +0200
committerMiklos Vajna <vmiklos@collabora.com>2020-05-29 08:41:58 +0200
commitc05d3f377054f5a7d4f4fb7bc23b0398d6b19347 (patch)
treed4d38e1145af8bbb33cbd0f6fd4f4a807641e696 /xmloff
parent8c84448febf817875ad0d377de0f0b34987992cb (diff)
xmloff: create XMLAutoTextEventExport instances with an uno constructor
See tdf#74608 for motivation. Change-Id: I068b45302d200ccbde082a748a110324bbbbbaec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95065 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/inc/facreg.hxx7
-rw-r--r--xmloff/source/core/facreg.cxx3
-rw-r--r--xmloff/source/text/XMLAutoTextEventExport.cxx21
-rw-r--r--xmloff/util/xo.component3
4 files changed, 9 insertions, 25 deletions
diff --git a/xmloff/inc/facreg.hxx b/xmloff/inc/facreg.hxx
index e810c5465831..82d5d3e73b59 100644
--- a/xmloff/inc/facreg.hxx
+++ b/xmloff/inc/facreg.hxx
@@ -31,13 +31,6 @@ namespace com::sun::star {
namespace uno { class XInterface; }
}
-// writer autotext event export
-OUString XMLAutoTextEventExport_getImplementationName() throw();
-css::uno::Sequence<OUString> XMLAutoTextEventExport_getSupportedServiceNames() throw();
-/// @throws css::uno::Exception
-css::uno::Reference<css::uno::XInterface> XMLAutoTextEventExport_createInstance(
- css::uno::Reference<css::lang::XMultiServiceFactory> const & rSMgr);
-
// writer autotext event import
OUString XMLAutoTextEventImport_getImplementationName() throw();
css::uno::Sequence<OUString> XMLAutoTextEventImport_getSupportedServiceNames() throw();
diff --git a/xmloff/source/core/facreg.cxx b/xmloff/source/core/facreg.cxx
index 52c719d30d48..377f05204c1a 100644
--- a/xmloff/source/core/facreg.cxx
+++ b/xmloff/source/core/facreg.cxx
@@ -55,8 +55,7 @@ XMLOFF_DLLPUBLIC void * xo_component_getFactory( const char * pImplName, void *
const sal_Int32 nImplNameLen = strlen( pImplName );
// auto text import/export
- SINGLEFACTORY( XMLAutoTextEventExport )
- else SINGLEFACTORY( XMLAutoTextEventImport )
+ SINGLEFACTORY( XMLAutoTextEventImport )
else SINGLEFACTORY( XMLAutoTextEventExportOOO )
if( xFactory.is())
diff --git a/xmloff/source/text/XMLAutoTextEventExport.cxx b/xmloff/source/text/XMLAutoTextEventExport.cxx
index 7ae9eb5ca742..e5e1b220cb1f 100644
--- a/xmloff/source/text/XMLAutoTextEventExport.cxx
+++ b/xmloff/source/text/XMLAutoTextEventExport.cxx
@@ -199,22 +199,13 @@ void XMLAutoTextEventExport::ExportContent_() {}
// methods to support the component registration
-Sequence< OUString > XMLAutoTextEventExport_getSupportedServiceNames()
- throw()
-{
- Sequence<OUString> aSeq { XMLAutoTextEventExport_getImplementationName() };
- return aSeq;
-}
-
-OUString XMLAutoTextEventExport_getImplementationName() throw()
-{
- return "com.sun.star.comp.Writer.XMLOasisAutotextEventsExporter";
-}
-
-Reference< XInterface > XMLAutoTextEventExport_createInstance(
- const Reference< XMultiServiceFactory > & rSMgr)
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+com_sun_star_comp_Writer_XMLOasisAutotextEventsExporter_get_implementation(
+ css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
{
- return static_cast<cppu::OWeakObject*>(new XMLAutoTextEventExport( comphelper::getComponentContext(rSMgr), XMLAutoTextEventExport_getImplementationName(), SvXMLExportFlags::ALL|SvXMLExportFlags::OASIS));
+ return cppu::acquire(new XMLAutoTextEventExport(
+ context, "com.sun.star.comp.Writer.XMLOasisAutotextEventsExporter",
+ SvXMLExportFlags::ALL | SvXMLExportFlags::OASIS));
}
// methods to support the component registration
diff --git a/xmloff/util/xo.component b/xmloff/util/xo.component
index 9942e90b6a65..0219cc5328ad 100644
--- a/xmloff/util/xo.component
+++ b/xmloff/util/xo.component
@@ -211,7 +211,8 @@
<service name="com.sun.star.comp.Writer.XMLAutotextEventsExporter"/>
</implementation>
<implementation
- name="com.sun.star.comp.Writer.XMLOasisAutotextEventsExporter">
+ name="com.sun.star.comp.Writer.XMLOasisAutotextEventsExporter"
+ constructor="com_sun_star_comp_Writer_XMLOasisAutotextEventsExporter_get_implementation">
<service name="com.sun.star.comp.Writer.XMLOasisAutotextEventsExporter"/>
</implementation>
<implementation