[Libreoffice-commits] core.git: filter/Library_storagefd.mk filter/source solenv/bin

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Sun Jul 12 12:22:09 UTC 2020


 filter/Library_storagefd.mk                           |    1 
 filter/source/storagefilterdetect/fdcomp.cxx          |   36 ------------------
 filter/source/storagefilterdetect/filterdetect.cxx    |   28 +++++---------
 filter/source/storagefilterdetect/filterdetect.hxx    |    6 ---
 filter/source/storagefilterdetect/storagefd.component |    5 +-
 solenv/bin/native-code.py                             |    5 +-
 6 files changed, 16 insertions(+), 65 deletions(-)

New commits:
commit 6a9652b05c2d5df69a09927cb2d28215aa9e795c
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sat Jul 11 21:03:34 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sun Jul 12 14:21:29 2020 +0200

    filter/storagefd: create instances with uno constructors
    
    See tdf#74608 for motivation.
    
    Change-Id: I7329893b62a9fb511535f6caadcdb6e007aadfd7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98580
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/filter/Library_storagefd.mk b/filter/Library_storagefd.mk
index 4b9d948f3d97..938096ecef0f 100644
--- a/filter/Library_storagefd.mk
+++ b/filter/Library_storagefd.mk
@@ -28,7 +28,6 @@ $(eval $(call gb_Library_use_libraries,storagefd,\
 ))
 
 $(eval $(call gb_Library_add_exception_objects,storagefd,\
-    filter/source/storagefilterdetect/fdcomp \
     filter/source/storagefilterdetect/filterdetect \
 ))
 
diff --git a/filter/source/storagefilterdetect/fdcomp.cxx b/filter/source/storagefilterdetect/fdcomp.cxx
deleted file mode 100644
index 6649603f1823..000000000000
--- a/filter/source/storagefilterdetect/fdcomp.cxx
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#include <sal/config.h>
-
-#include <cppuhelper/factory.hxx>
-#include <cppuhelper/implementationentry.hxx>
-#include <sal/types.h>
-
-#include "filterdetect.hxx"
-
-namespace {
-
-cppu::ImplementationEntry const services[] = {
-    { &StorageFilterDetect_createInstance, &StorageFilterDetect_getImplementationName,
-      &StorageFilterDetect_getSupportedServiceNames,
-      &cppu::createSingleComponentFactory, nullptr, 0 },
-    { nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
-};
-
-}
-
-extern "C" SAL_DLLPUBLIC_EXPORT void * storagefd_component_getFactory(
-    char const * pImplName, void * pServiceManager, void * pRegistryKey)
-{
-    return cppu::component_getFactoryHelper(
-        pImplName, pServiceManager, pRegistryKey, services);
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/storagefilterdetect/filterdetect.cxx b/filter/source/storagefilterdetect/filterdetect.cxx
index 4937349dbd6b..f2eba546a4d3 100644
--- a/filter/source/storagefilterdetect/filterdetect.cxx
+++ b/filter/source/storagefilterdetect/filterdetect.cxx
@@ -164,26 +164,10 @@ OUString SAL_CALL StorageFilterDetect::detect(uno::Sequence<beans::PropertyValue
 // XInitialization
 void SAL_CALL StorageFilterDetect::initialize(const uno::Sequence<uno::Any>& /*aArguments*/) {}
 
-OUString StorageFilterDetect_getImplementationName()
-{
-    return "com.sun.star.comp.filters.StorageFilterDetect";
-}
-
-uno::Sequence<OUString> StorageFilterDetect_getSupportedServiceNames()
-{
-    return { "com.sun.star.document.ExtendedTypeDetection", "com.sun.star.comp.filters.StorageFilterDetect" };
-}
-
-uno::Reference<uno::XInterface> StorageFilterDetect_createInstance(
-    const uno::Reference<uno::XComponentContext> & rCxt)
-{
-    return static_cast<cppu::OWeakObject*>(new StorageFilterDetect(rCxt));
-}
-
 // XServiceInfo
 OUString SAL_CALL StorageFilterDetect::getImplementationName()
 {
-    return StorageFilterDetect_getImplementationName();
+    return "com.sun.star.comp.filters.StorageFilterDetect";
 }
 
 sal_Bool SAL_CALL StorageFilterDetect::supportsService(const OUString& rServiceName)
@@ -193,7 +177,15 @@ sal_Bool SAL_CALL StorageFilterDetect::supportsService(const OUString& rServiceN
 
 uno::Sequence<OUString> SAL_CALL StorageFilterDetect::getSupportedServiceNames()
 {
-    return StorageFilterDetect_getSupportedServiceNames();
+    return { "com.sun.star.document.ExtendedTypeDetection", "com.sun.star.comp.filters.StorageFilterDetect" };
+}
+
+
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+filter_StorageFilterDetect_get_implementation(
+    css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
+{
+    return cppu::acquire(new StorageFilterDetect(context));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/storagefilterdetect/filterdetect.hxx b/filter/source/storagefilterdetect/filterdetect.hxx
index 8c13868ff817..27556f376297 100644
--- a/filter/source/storagefilterdetect/filterdetect.hxx
+++ b/filter/source/storagefilterdetect/filterdetect.hxx
@@ -53,12 +53,6 @@ public:
     virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
 };
 
-OUString StorageFilterDetect_getImplementationName();
-
-css::uno::Sequence<OUString> StorageFilterDetect_getSupportedServiceNames();
-
-css::uno::Reference<css::uno::XInterface>
-StorageFilterDetect_createInstance(const css::uno::Reference<css::uno::XComponentContext>& rCxt);
 
 #endif
 
diff --git a/filter/source/storagefilterdetect/storagefd.component b/filter/source/storagefilterdetect/storagefd.component
index 9f85bfa1efa2..4a2ea0bf4c5b 100644
--- a/filter/source/storagefilterdetect/storagefd.component
+++ b/filter/source/storagefilterdetect/storagefd.component
@@ -8,8 +8,9 @@
  -->
 
 <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
-    prefix="storagefd" xmlns="http://openoffice.org/2010/uno-components">
-  <implementation name="com.sun.star.comp.filters.StorageFilterDetect">
+    xmlns="http://openoffice.org/2010/uno-components">
+  <implementation name="com.sun.star.comp.filters.StorageFilterDetect"
+    constructor="filter_StorageFilterDetect_get_implementation">
     <service name="com.sun.star.document.ExtendedTypeDetection"/>
   </implementation>
 </component>
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 344a5083c6bf..b2a0aed722ad 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -33,7 +33,6 @@ core_factory_list = [
     ("libpackage2.a", "package2_component_getFactory"),
     ("libsmlo.a", "sm_component_getFactory"),
     ("libsrtrs1.a", "srtrs1_component_getFactory"),
-    ("libstoragefdlo.a", "storagefd_component_getFactory"),
     ("libucb1.a", "ucb_component_getFactory"),
     ("libucpexpand1lo.a", "ucpexpand1_component_getFactory", "#ifdef ANDROID"),
     ("libucpfile1.a", "ucpfile_component_getFactory"),
@@ -160,7 +159,9 @@ core_constructor_list = [
 # filter/source/xmlfilterdetect/xmlfd.component
     "filter_XMLFilterDetect_get_implementation",
 # filter/source/xmlfilteradaptor/xmlfa.component
-    "filter_XmlFilterAdaptor_get_implementation
+    "filter_XmlFilterAdaptor_get_implementation",
+# filter/source/storagefilterdetect/storagefd.component
+    "filter_StorageFilterDetect_get_implementation",
 # forms/util/frm.component
     ("com_sun_star_comp_forms_FormOperations_get_implementation", "#if HAVE_FEATURE_DBCONNECTIVITY"),
     ("com_sun_star_comp_forms_ODatabaseForm_get_implementation", "#if HAVE_FEATURE_DBCONNECTIVITY"),


More information about the Libreoffice-commits mailing list