sw: create DocxExport instances with an uno constructor

Change-Id: I34e674e4f3225e724fd9ed6d513fb66c2d5ebdd9
Reviewed-on: https://gerrit.libreoffice.org/61696
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
This commit is contained in:
Miklos Vajna 2018-10-11 22:58:00 +02:00
parent a0ed677fbc
commit b6137b659e
3 changed files with 9 additions and 37 deletions

View file

@ -371,6 +371,7 @@ writer_constructor_list = [
"com_sun_star_comp_writer_FormatDetector_get_implementation",
# sw/util/msword.component
"com_sun_star_comp_Writer_RtfExport_get_implementation",
"com_sun_star_comp_Writer_DocxExport_get_implementation",
# writerfilter/util/writerfilter.component
"com_sun_star_comp_Writer_RtfFilter_get_implementation",
"com_sun_star_comp_Writer_WriterFilter_get_implementation",

View file

@ -96,47 +96,17 @@ bool DocxExportFilter::exportDocument()
}
// UNO stuff so that the filter is registered
#define IMPL_NAME "com.sun.star.comp.Writer.DocxExport"
static OUString DocxExport_getImplementationName()
{
return OUString( IMPL_NAME );
}
OUString DocxExportFilter::getImplementationName()
{
return DocxExport_getImplementationName();
return OUString("com.sun.star.comp.Writer.DocxExport");
}
static uno::Sequence< OUString > DocxExport_getSupportedServiceNames() throw()
extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
com_sun_star_comp_Writer_DocxExport_get_implementation(uno::XComponentContext* pCtx,
uno::Sequence<uno::Any> const& /*rSeq*/)
{
return uno::Sequence< OUString > { "com.sun.star.document.ExportFilter" };
return cppu::acquire(new DocxExportFilter(pCtx));
}
/// @throws uno::Exception
static uno::Reference< uno::XInterface > DocxExport_createInstance(const uno::Reference< uno::XComponentContext > & xCtx )
{
return static_cast<cppu::OWeakObject*>(new DocxExportFilter( xCtx ));
}
extern "C"
{
::cppu::ImplementationEntry const entries [] =
{
{
DocxExport_createInstance, DocxExport_getImplementationName,
DocxExport_getSupportedServiceNames, ::cppu::createSingleComponentFactory,
nullptr, 0
},
{ nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
};
SAL_DLLPUBLIC_EXPORT void* msword_component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* pRegistryKey )
{
return ::cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey, entries );
}
} // extern "C"
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -17,12 +17,13 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
prefix="msword" xmlns="http://openoffice.org/2010/uno-components">
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.Writer.RtfExport"
constructor="com_sun_star_comp_Writer_RtfExport_get_implementation">
<service name="com.sun.star.comp.Writer.RtfExport"/>
</implementation>
<implementation name="com.sun.star.comp.Writer.DocxExport">
<implementation name="com.sun.star.comp.Writer.DocxExport"
constructor="com_sun_star_comp_Writer_DocxExport_get_implementation">
<service name="com.sun.star.comp.Writer.DocxExport"/>
</implementation>
</component>