diff options
Diffstat (limited to 'stoc/source/implementationregistration/implreg.cxx')
-rw-r--r-- | stoc/source/implementationregistration/implreg.cxx | 55 |
1 files changed, 23 insertions, 32 deletions
diff --git a/stoc/source/implementationregistration/implreg.cxx b/stoc/source/implementationregistration/implreg.cxx index 66626a8eb9c4..4e8e6970fff5 100644 --- a/stoc/source/implementationregistration/implreg.cxx +++ b/stoc/source/implementationregistration/implreg.cxx @@ -65,14 +65,11 @@ using namespace osl; #define IMPLNAME "com.sun.star.comp.stoc.ImplementationRegistration" #define SERVICENAME "com.sun.star.registry.ImplementationRegistration" -namespace stoc_impreg -{ + +namespace { + struct StringPool { - OUString sImplementationName; - OUString sServiceName; - OUString TMP; - OUString TEMP; OUString slash_UNO_slash_REGISTRY_LINKS; OUString slash_IMPLEMENTATIONS; OUString slash_UNO; @@ -85,11 +82,7 @@ struct StringPool OUString com_sun_star_registry_SimpleRegistry; OUString Registry; StringPool() - : sImplementationName( IMPLNAME ) - , sServiceName( SERVICENAME ) - , TMP( "TMP" ) - , TEMP( "TEMP" ) - , slash_UNO_slash_REGISTRY_LINKS( "/UNO/REGISTRY_LINKS") + : slash_UNO_slash_REGISTRY_LINKS( "/UNO/REGISTRY_LINKS") , slash_IMPLEMENTATIONS( "/IMPLEMENTATIONS" ) , slash_UNO( "/UNO") , slash_UNO_slash_SERVICES( "/UNO/SERVICES") @@ -119,25 +112,14 @@ const StringPool &spool() } return *pPool; } -} -namespace stoc_bootstrap -{ -Sequence< OUString > impreg_getSupportedServiceNames() +static Sequence< OUString > ImplementationRegistration_getSupportedServiceNames() { Sequence< OUString > seqNames(1); - seqNames.getArray()[0] = stoc_impreg::spool().sServiceName; + seqNames.getArray()[0] = SERVICENAME; return seqNames; } -OUString impreg_getImplementationName() -{ - return stoc_impreg::spool().sImplementationName; -} -} - -namespace stoc_impreg -{ //************************************************************************* // static deleteAllLinkReferences() // @@ -1327,7 +1309,7 @@ ImplementationRegistration::~ImplementationRegistration() {} // XServiceInfo OUString ImplementationRegistration::getImplementationName() throw(RuntimeException) { - return stoc_bootstrap::impreg_getImplementationName(); + return OUString(IMPLNAME); } // XServiceInfo @@ -1339,7 +1321,7 @@ sal_Bool ImplementationRegistration::supportsService(const OUString& ServiceName // XServiceInfo Sequence< OUString > ImplementationRegistration::getSupportedServiceNames(void) throw(RuntimeException) { - return stoc_bootstrap::impreg_getSupportedServiceNames(); + return ImplementationRegistration_getSupportedServiceNames(); } Reference< XSimpleRegistry > ImplementationRegistration::getRegistryFromServiceManager() @@ -1801,7 +1783,7 @@ void ImplementationRegistration::doRegister( xSourceKey = xReg->getRootKey(); Reference < XRegistryKey > xDestKey = xDest->getRootKey(); - mergeKeys( xDestKey, xSourceKey ); + stoc_impreg::mergeKeys( xDestKey, xSourceKey ); xDestKey->closeKey(); xSourceKey->closeKey(); } @@ -1840,17 +1822,26 @@ Reference< XSimpleRegistry > ImplementationRegistration::createTemporarySimpleRe OSL_ASSERT( xReg.is() ); return xReg; } + } -namespace stoc_bootstrap -{ -//************************************************************************* -Reference<XInterface> SAL_CALL ImplementationRegistration_CreateInstance( +static Reference<XInterface> ImplementationRegistration_CreateInstance( const Reference<XComponentContext> & xCtx ) // throw(Exception) { - return (XImplementationRegistration *)new stoc_impreg::ImplementationRegistration(xCtx); + return (XImplementationRegistration *)new ImplementationRegistration(xCtx); } +extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL +com_sun_star_comp_stoc_ImplementationRegistration_component_getFactory( + const char * , void * , void * ) +{ + Reference< css::lang::XSingleComponentFactory > xFactory; + xFactory = createSingleComponentFactory( + ImplementationRegistration_CreateInstance, + IMPLNAME, + ImplementationRegistration_getSupportedServiceNames() ); + xFactory->acquire(); + return xFactory.get(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |