[Libreoffice-commits] core.git: cppuhelper/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Tue Jan 14 15:32:29 UTC 2020


 cppuhelper/source/shlib.cxx |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

New commits:
commit 35fbf454055a18c8431808b955b54f2cf3200bb0
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Jan 14 15:27:56 2020 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Tue Jan 14 16:31:57 2020 +0100

    Remove unused prefix="direct" feature
    
    It got introduced with b6cebf4a3e2997e6489bba77b358b306f8f435ce "Allow UNO
    component libraries to have each implementation in its own function", then
    ae3a0c8da50b36db395984637f5ad74d3b4887bc "Add .component <implementation
    constructor='...' feature" removed all of its uses and noted:  "[...] (which had
    previously been adapted to use the prefix="direct" feature, which may become
    unnecessary again in the end, depending on how to handle single-instance
    services/singletons)."  Handling of single-instance services/singletons has been
    added with 997d21183322a0a94b96868073808841d2773902 "Support for singleton
    constructor functions" and the feature has really become unnecessary again.
    
    Change-Id: I1ab910805d61421f892a244313c8778cd453f98c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86765
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/cppuhelper/source/shlib.cxx b/cppuhelper/source/shlib.cxx
index c5979e642393..89ce8b8554db 100644
--- a/cppuhelper/source/shlib.cxx
+++ b/cppuhelper/source/shlib.cxx
@@ -255,20 +255,19 @@ void cppuhelper::detail::loadSharedLibComponentFactory(
         if (curEnv.get() != env.get()) {
             std::abort();//TODO
         }
-        OUString name(prefix == "direct" ? implementation : uri);
         SAL_INFO("cppuhelper.shlib", "prefix=" << prefix << " implementation=" << implementation << " uri=" << uri);
         lib_to_factory_mapping const * map = lo_get_factory_map();
         component_getFactoryFunc fp = 0;
         for (int i = 0; map[i].name != 0; ++i) {
-            if (name.equalsAscii(map[i].name)) {
+            if (uri.equalsAscii(map[i].name)) {
                 fp = map[i].component_getFactory_function;
                 break;
             }
         }
         if (fp == 0) {
-            SAL_WARN("cppuhelper", "unknown factory name \"" << name << "\"");
+            SAL_WARN("cppuhelper", "unknown factory name \"" << uri << "\"");
             throw css::loader::CannotActivateFactoryException(
-                "unknown factory name \"" + name + "\"",
+                "unknown factory name \"" + uri + "\"",
                 css::uno::Reference<css::uno::XInterface>());
         }
         *factory = invokeComponentFactory(
@@ -301,9 +300,7 @@ void cppuhelper::detail::loadSharedLibComponentFactory(
     if (constructor.isEmpty()) {
         OUString sym;
         SAL_INFO("cppuhelper.shlib", "prefix=" << prefix << " implementation=" << implementation << " uri=" << uri);
-        if (prefix == "direct") {
-            sym = implementation.replace('.', '_') + "_" COMPONENT_GETFACTORY;
-        } else if (!prefix.isEmpty()) {
+        if (!prefix.isEmpty()) {
             sym = prefix + "_" COMPONENT_GETFACTORY;
         } else {
             sym = COMPONENT_GETFACTORY;


More information about the Libreoffice-commits mailing list