diff options
Diffstat (limited to 'cppuhelper/source')
-rw-r--r-- | cppuhelper/source/factory.cxx | 23 | ||||
-rw-r--r-- | cppuhelper/source/gcc3.map | 1 | ||||
-rw-r--r-- | cppuhelper/source/gcc3os2.map | 1 | ||||
-rw-r--r-- | cppuhelper/source/shlib.cxx | 14 |
4 files changed, 33 insertions, 6 deletions
diff --git a/cppuhelper/source/factory.cxx b/cppuhelper/source/factory.cxx index 2958e1505f5f..a87d39ad91f5 100644 --- a/cppuhelper/source/factory.cxx +++ b/cppuhelper/source/factory.cxx @@ -31,9 +31,11 @@ #include <osl/diagnose.h> #include <osl/mutex.hxx> #include <cppuhelper/weak.hxx> +#include <cppuhelper/bootstrap.hxx> #include <cppuhelper/component.hxx> #include <cppuhelper/factory.hxx> #include <cppuhelper/implbase3.hxx> +#include <cppuhelper/shlib.hxx> #include <cppuhelper/typeprovider.hxx> #include <rtl/instance.hxx> #include <rtl/unload.h> @@ -832,6 +834,7 @@ Reference< XInterface > ORegistryFactoryHelper::createModuleFactory() OUString aActivatorUrl; OUString aActivatorName; OUString aLocation; + OUString aPrefix; Reference<XRegistryKey > xActivatorKey = xImplementationKey->openKey( OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/ACTIVATOR") ) ); @@ -847,6 +850,15 @@ Reference< XInterface > ORegistryFactoryHelper::createModuleFactory() OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/LOCATION") ) ); if( xLocationKey.is() && xLocationKey->getValueType() == RegistryValueType_ASCII ) aLocation = xLocationKey->getAsciiValue(); + + Reference<XRegistryKey > xPrefixKey = xImplementationKey->openKey( + OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/PREFIX") ) ); + if( xPrefixKey.is() && xPrefixKey->getValueType() == RegistryValueType_ASCII ) + { + aPrefix = xPrefixKey->getAsciiValue(); + if (aPrefix.getLength() != 0) + aPrefix = aPrefix + OUSTR("_"); + } } else { @@ -881,6 +893,17 @@ Reference< XInterface > ORegistryFactoryHelper::createModuleFactory() Reference<XInterface > x = xSMgr->createInstance( aActivatorName ); Reference<XImplementationLoader > xLoader( x, UNO_QUERY ); Reference<XInterface > xMF; + if( aActivatorName == OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.loader.SharedLibrary") ) ) + { + try + { + return loadSharedLibComponentFactory( bootstrap_expandUri( aLocation ), OUString(), aImplementationName, xSMgr, xImplementationKey, aPrefix ); + } + catch ( IllegalArgumentException & e ) + { + throw RuntimeException( e.Message, e.Context ); + } + } if (xLoader.is()) { xFactory = xLoader->activate( aImplementationName, aActivatorUrl, aLocation, xImplementationKey ); diff --git a/cppuhelper/source/gcc3.map b/cppuhelper/source/gcc3.map index 7017d274c95d..156fcc12f28f 100644 --- a/cppuhelper/source/gcc3.map +++ b/cppuhelper/source/gcc3.map @@ -158,6 +158,7 @@ _ZN4cppu28createSingleComponentFactoryEPFN3com3sun4star3uno9ReferenceINS3_10XInt _ZN4cppu29WeakComponentImplHelper_queryERKN3com3sun4star3uno4TypeEPNS_10class_dataEPvPNS_27WeakComponentImplHelperBaseE; _ZN4cppu29installTypeDescriptionManagerERKN3com3sun4star3uno9ReferenceINS2_9container23XHierarchicalNameAccessEEE; _ZN4cppu29loadSharedLibComponentFactoryERKN3rtl8OUStringES3_S3_RKN3com3sun4star3uno9ReferenceINS6_4lang20XMultiServiceFactoryEEERKNS8_INS6_8registry12XRegistryKeyEEE; +_ZN4cppu29loadSharedLibComponentFactoryERKN3rtl8OUStringES3_S3_RKN3com3sun4star3uno9ReferenceINS6_4lang20XMultiServiceFactoryEEERKNS8_INS6_8registry12XRegistryKeyEEES3_; _ZN4cppu30ImplHelper_getImplementationIdEPNS_10class_dataE; _ZN4cppu30WeakAggComponentImplHelperBase14queryInterfaceERKN3com3sun4star3uno4TypeE; _ZN4cppu30WeakAggComponentImplHelperBase16addEventListenerERKN3com3sun4star3uno9ReferenceINS3_4lang14XEventListenerEEE; diff --git a/cppuhelper/source/gcc3os2.map b/cppuhelper/source/gcc3os2.map index 681a076cee79..5bd0ec5d1787 100644 --- a/cppuhelper/source/gcc3os2.map +++ b/cppuhelper/source/gcc3os2.map @@ -158,6 +158,7 @@ _ZN4cppu28createSingleComponentFactoryEPFN3com3sun4star3uno9ReferenceINS3_10XInt _ZN4cppu29WeakComponentImplHelper_queryERKN3com3sun4star3uno4TypeEPNS_10class_dataEPvPNS_27WeakComponentImplHelperBaseE; _ZN4cppu29installTypeDescriptionManagerERKN3com3sun4star3uno9ReferenceINS2_9container23XHierarchicalNameAccessEEE; _ZN4cppu29loadSharedLibComponentFactoryERKN3rtl8OUStringES3_S3_RKN3com3sun4star3uno9ReferenceINS6_4lang20XMultiServiceFactoryEEERKNS8_INS6_8registry12XRegistryKeyEEE; +_ZN4cppu29loadSharedLibComponentFactoryERKN3rtl8OUStringES3_S3_RKN3com3sun4star3uno9ReferenceINS6_4lang20XMultiServiceFactoryEEERKNS8_INS6_8registry12XRegistryKeyEEES3_; _ZN4cppu30ImplHelper_getImplementationIdEPNS_10class_dataE; _ZN4cppu30WeakAggComponentImplHelperBase14queryInterfaceERKN3com3sun4star3uno4TypeE; _ZN4cppu30WeakAggComponentImplHelperBase16addEventListenerERKN3com3sun4star3uno9ReferenceINS3_4lang14XEventListenerEEE; diff --git a/cppuhelper/source/shlib.cxx b/cppuhelper/source/shlib.cxx index 544ba8c5d6fc..1127cc3f0a4a 100644 --- a/cppuhelper/source/shlib.cxx +++ b/cppuhelper/source/shlib.cxx @@ -275,13 +275,14 @@ static OUString getLibEnv(OUString const & aModulePath, uno::Environment * pEnv, OUString * pSourceEnv_name, uno::Environment const & cTargetEnv, - OUString const & cImplName = OUString()) + OUString const & cImplName = OUString(), + OUString const & rPrefix = OUString()) { OUString aExcMsg; sal_Char const * pEnvTypeName = NULL; - OUString aGetEnvNameExt = OUSTR(COMPONENT_GETENVEXT); + OUString aGetEnvNameExt = rPrefix + OUSTR(COMPONENT_GETENVEXT); component_getImplementationEnvironmentExtFunc pGetImplEnvExt = (component_getImplementationEnvironmentExtFunc)osl_getFunctionSymbol(lib, aGetEnvNameExt.pData); @@ -292,7 +293,7 @@ static OUString getLibEnv(OUString const & aModulePath, } else { - OUString aGetEnvName = OUSTR(COMPONENT_GETENV); + OUString aGetEnvName = rPrefix + OUSTR(COMPONENT_GETENV); component_getImplementationEnvironmentFunc pGetImplEnv = (component_getImplementationEnvironmentFunc)osl_getFunctionSymbol( lib, aGetEnvName.pData ); @@ -348,7 +349,8 @@ Reference< XInterface > SAL_CALL loadSharedLibComponentFactory( OUString const & rLibName, OUString const & rPath, OUString const & rImplName, Reference< lang::XMultiServiceFactory > const & xMgr, - Reference< registry::XRegistryKey > const & xKey ) + Reference< registry::XRegistryKey > const & xKey, + OUString const & rPrefix ) SAL_THROW( (loader::CannotActivateFactoryException) ) { OUString aModulePath( makeComponentPath( rLibName, rPath ) ); @@ -376,10 +378,10 @@ Reference< XInterface > SAL_CALL loadSharedLibComponentFactory( OUString aEnvTypeName; - OUString aExcMsg = getLibEnv(aModulePath, lib, &env, &aEnvTypeName, currentEnv, rImplName); + OUString aExcMsg = getLibEnv(aModulePath, lib, &env, &aEnvTypeName, currentEnv, rImplName, rPrefix); if (!aExcMsg.getLength()) { - OUString aGetFactoryName = OUSTR(COMPONENT_GETFACTORY); + OUString aGetFactoryName = rPrefix + OUSTR(COMPONENT_GETFACTORY); oslGenericFunction pSym = osl_getFunctionSymbol( lib, aGetFactoryName.pData ); if (pSym != 0) { |