[Libreoffice-commits] core.git: solenv/bin sw/source sw/util

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Oct 12 07:09:13 UTC 2018


 solenv/bin/native-code.py                 |    1 
 sw/source/filter/ww8/docxexportfilter.cxx |   40 +++---------------------------
 sw/util/msword.component                  |    5 ++-
 3 files changed, 9 insertions(+), 37 deletions(-)

New commits:
commit b6137b659e5358dfb5be4c4191bc1199de190f9e
Author:     Miklos Vajna <vmiklos at collabora.co.uk>
AuthorDate: Thu Oct 11 22:58:00 2018 +0200
Commit:     Miklos Vajna <vmiklos at collabora.co.uk>
CommitDate: Fri Oct 12 09:08:45 2018 +0200

    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 at collabora.co.uk>

diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index c552058b72bf..d93d30c1951c 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -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",
diff --git a/sw/source/filter/ww8/docxexportfilter.cxx b/sw/source/filter/ww8/docxexportfilter.cxx
index 208f60bb0ec1..67167e6c7039 100644
--- a/sw/source/filter/ww8/docxexportfilter.cxx
+++ b/sw/source/filter/ww8/docxexportfilter.cxx
@@ -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();
-}
-
-static uno::Sequence< OUString > DocxExport_getSupportedServiceNames() throw()
-{
-    return uno::Sequence< OUString > { "com.sun.star.document.ExportFilter" };
-}
-
-/// @throws uno::Exception
-static uno::Reference< uno::XInterface > DocxExport_createInstance(const uno::Reference< uno::XComponentContext > & xCtx )
-{
-    return static_cast<cppu::OWeakObject*>(new DocxExportFilter( xCtx ));
+    return OUString("com.sun.star.comp.Writer.DocxExport");
 }
 
-extern "C"
-{
-
-::cppu::ImplementationEntry const entries [] =
+extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface*
+com_sun_star_comp_Writer_DocxExport_get_implementation(uno::XComponentContext* pCtx,
+                                                       uno::Sequence<uno::Any> const& /*rSeq*/)
 {
-    {
-        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 );
+    return cppu::acquire(new DocxExportFilter(pCtx));
 }
 
-} // extern "C"
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/util/msword.component b/sw/util/msword.component
index 2d07b1a52a7b..0537941b8cc3 100644
--- a/sw/util/msword.component
+++ b/sw/util/msword.component
@@ -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>


More information about the Libreoffice-commits mailing list