Shortcut common case of calling same-env component_getFactory fn

Change-Id: I7f5d31c3b3e128b2df4d83c915673bf7b5d2ab8c
This commit is contained in:
Stephan Bergmann
2013-12-13 16:18:52 +01:00
parent d203855908
commit a4ed79bbf6

View File

@@ -188,7 +188,16 @@ Reference< XInterface > invokeComponentFactory(
fprintf(stderr, "invokeComponentFactory envDcp:%s implName:%s modPath:%s\n", envDcp.getStr(), implName.getStr(), modPath.getStr());
}
#endif
if (env.get() == currentEnv.get())
{
xRet.set(
static_cast<css::uno::XInterface *>(
(*reinterpret_cast<component_getFactoryFunc>(pGetter))(
aImplName.getStr(), xMgr.get(), 0)),
SAL_NO_ACQUIRE);
}
else
{
Mapping aCurrent2Env( currentEnv, env );
Mapping aEnv2Current( env, currentEnv );
@@ -230,6 +239,7 @@ Reference< XInterface > invokeComponentFactory(
"cannot get uno mappings: C++ <=> UNO!";
}
}
}
else
{
rExcMsg = "cannot get uno environments!";