Default to current language binding name, if not specified.

Signed-off-by: Michael Meeks <michael.meeks@novell.com>
This commit is contained in:
Matúš Kukan
2011-07-11 17:41:58 +01:00
committed by Michael Meeks
parent dc1e0758a8
commit d6f18bf9e0

View File

@@ -270,16 +270,13 @@ static OUString makeComponentPath(
} }
//============================================================================== //==============================================================================
static OUString getLibEnv(OUString const & aModulePath, static OUString getLibEnv(oslModule lib,
oslModule lib,
uno::Environment * pEnv, uno::Environment * pEnv,
OUString * pSourceEnv_name, OUString * pSourceEnv_name,
uno::Environment const & cTargetEnv, uno::Environment const & cTargetEnv,
OUString const & cImplName = OUString(), OUString const & cImplName = OUString(),
OUString const & rPrefix = OUString()) OUString const & rPrefix = OUString())
{ {
OUString aExcMsg;
sal_Char const * pEnvTypeName = NULL; sal_Char const * pEnvTypeName = NULL;
OUString aGetEnvNameExt = rPrefix + OUSTR(COMPONENT_GETENVEXT); OUString aGetEnvNameExt = rPrefix + OUSTR(COMPONENT_GETENVEXT);
@@ -300,13 +297,8 @@ static OUString getLibEnv(OUString const & aModulePath,
if (pGetImplEnv) if (pGetImplEnv)
pGetImplEnv(&pEnvTypeName, (uno_Environment **)pEnv); pGetImplEnv(&pEnvTypeName, (uno_Environment **)pEnv);
else else // this symbol used to be mandatory, but is no longer
{ pEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
aExcMsg = aModulePath;
aExcMsg += OUSTR(": cannot get symbol: ");
aExcMsg += aGetEnvName;
aExcMsg += OUSTR("- nor: ");
}
} }
if (!pEnv->is() && pEnvTypeName) if (!pEnv->is() && pEnvTypeName)
@@ -328,10 +320,8 @@ static OUString getLibEnv(OUString const & aModulePath,
} }
} while( nIndex != -1 ); } while( nIndex != -1 );
} }
} }
return OUString();
return aExcMsg;
} }
extern "C" {static void s_getFactory(va_list * pParam) extern "C" {static void s_getFactory(va_list * pParam)
@@ -389,7 +379,7 @@ Reference< XInterface > SAL_CALL loadSharedLibComponentFactory(
OUString aEnvTypeName; OUString aEnvTypeName;
OUString aExcMsg = getLibEnv(aModulePath, lib, &env, &aEnvTypeName, currentEnv, rImplName, rPrefix); OUString aExcMsg = getLibEnv(lib, &env, &aEnvTypeName, currentEnv, rImplName, rPrefix);
if (!aExcMsg.getLength()) if (!aExcMsg.getLength())
{ {
OUString aGetFactoryName = rPrefix + OUSTR(COMPONENT_GETFACTORY); OUString aGetFactoryName = rPrefix + OUSTR(COMPONENT_GETFACTORY);
@@ -535,7 +525,7 @@ void SAL_CALL writeSharedLibComponentInfo(
uno::Environment env; uno::Environment env;
OUString aEnvTypeName; OUString aEnvTypeName;
OUString aExcMsg = getLibEnv(aModulePath, lib, &env, &aEnvTypeName, currentEnv); OUString aExcMsg = getLibEnv(lib, &env, &aEnvTypeName, currentEnv);
if (!aExcMsg.getLength()) if (!aExcMsg.getLength())
{ {
OUString aWriteInfoName = OUSTR(COMPONENT_WRITEINFO); OUString aWriteInfoName = OUSTR(COMPONENT_WRITEINFO);