[Libreoffice-commits] .: cppuhelper/source

Michael Meeks michael at kemper.freedesktop.org
Mon Jul 11 09:48:28 PDT 2011


 cppuhelper/source/shlib.cxx |   28 +++++++++-------------------
 1 file changed, 9 insertions(+), 19 deletions(-)

New commits:
commit 6d8f44b0bb27d97d679d2a6f699a25048a905951
Author: Matúš Kukan <matus.kukan at gmail.com>
Date:   Mon Jul 11 17:41:58 2011 +0100

    Default to current language binding name, if not specified.
    
    Signed-off-by: Michael Meeks <michael.meeks at novell.com>

diff --git a/cppuhelper/source/shlib.cxx b/cppuhelper/source/shlib.cxx
index 1fb136a..a979454 100644
--- a/cppuhelper/source/shlib.cxx
+++ b/cppuhelper/source/shlib.cxx
@@ -270,16 +270,13 @@ static OUString makeComponentPath(
 }
 
 //==============================================================================
-static OUString getLibEnv(OUString         const & aModulePath,
-                          oslModule                lib, 
-                          uno::Environment       * pEnv, 
+static OUString getLibEnv(oslModule                lib,
+                          uno::Environment       * pEnv,
                           OUString               * pSourceEnv_name,
                           uno::Environment const & cTargetEnv,
                           OUString         const & cImplName = OUString(),
                           OUString         const & rPrefix = OUString())
 {
-    OUString aExcMsg;
-
     sal_Char const * pEnvTypeName = NULL;
 
     OUString aGetEnvNameExt = rPrefix + OUSTR(COMPONENT_GETENVEXT);
@@ -300,15 +297,10 @@ static OUString getLibEnv(OUString         const & aModulePath,
         if (pGetImplEnv)
             pGetImplEnv(&pEnvTypeName, (uno_Environment **)pEnv);
 
-        else
-        {
-            aExcMsg = aModulePath;
-            aExcMsg += OUSTR(": cannot get symbol: ");
-            aExcMsg += aGetEnvName;
-            aExcMsg += OUSTR("- nor: ");
-        }
+        else // this symbol used to be mandatory, but is no longer
+            pEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
     }
-    
+
     if (!pEnv->is() && pEnvTypeName)
     {
         *pSourceEnv_name = OUString::createFromAscii(pEnvTypeName);
@@ -326,12 +318,10 @@ static OUString getLibEnv(OUString         const & aModulePath,
                     *pSourceEnv_name += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(":log"));
                     break;
                 }
-            } while( nIndex != -1 );            
+            } while( nIndex != -1 );
         }
-        
     }
-
-    return aExcMsg;
+    return OUString();
 }
 
 extern "C" {static void s_getFactory(va_list * pParam) 
@@ -389,7 +379,7 @@ Reference< XInterface > SAL_CALL loadSharedLibComponentFactory(
 
     OUString aEnvTypeName;
 
-    OUString aExcMsg = getLibEnv(aModulePath, lib, &env, &aEnvTypeName, currentEnv, rImplName, rPrefix);
+    OUString aExcMsg = getLibEnv(lib, &env, &aEnvTypeName, currentEnv, rImplName, rPrefix);
     if (!aExcMsg.getLength())
     {
         OUString aGetFactoryName = rPrefix + OUSTR(COMPONENT_GETFACTORY);
@@ -535,7 +525,7 @@ void SAL_CALL writeSharedLibComponentInfo(
     uno::Environment env;
     
     OUString aEnvTypeName;
-    OUString aExcMsg = getLibEnv(aModulePath, lib, &env, &aEnvTypeName, currentEnv);
+    OUString aExcMsg = getLibEnv(lib, &env, &aEnvTypeName, currentEnv);
     if (!aExcMsg.getLength())
     {
         OUString aWriteInfoName = OUSTR(COMPONENT_WRITEINFO);


More information about the Libreoffice-commits mailing list