diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-06-01 15:34:41 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-06-01 15:35:10 +0100 |
commit | bc77c1580725079b3226bc1070549f0872a110ec (patch) | |
tree | 94f6adb93400adef0efb8d325bb16dc2fe51fae0 /stoc | |
parent | 4060d5a59af082993e47aae625db024e8f5ac872 (diff) |
fix up
Diffstat (limited to 'stoc')
-rw-r--r-- | stoc/source/corereflection/crefl.cxx | 27 | ||||
-rw-r--r-- | stoc/source/defaultregistry/defaultregistry.cxx | 27 | ||||
-rw-r--r-- | stoc/source/implementationregistration/implreg.cxx | 15 | ||||
-rw-r--r-- | stoc/source/invocation/invocation.cxx | 27 | ||||
-rw-r--r-- | stoc/source/invocation_adapterfactory/iafactory.cxx | 29 | ||||
-rw-r--r-- | stoc/source/javaloader/javaloader.cxx | 35 | ||||
-rw-r--r-- | stoc/source/loader/dllcomponentloader.cxx | 27 | ||||
-rw-r--r-- | stoc/source/namingservice/namingservice.cxx | 27 | ||||
-rw-r--r-- | stoc/source/registry_tdprovider/tdprovider.cxx | 27 | ||||
-rw-r--r-- | stoc/source/security/access_controller.cxx | 6 | ||||
-rw-r--r-- | stoc/source/security/file_policy.cxx | 6 | ||||
-rw-r--r-- | stoc/source/tdmanager/tdmgr.cxx | 27 | ||||
-rw-r--r-- | stoc/source/typeconv/convert.cxx | 27 |
13 files changed, 54 insertions, 253 deletions
diff --git a/stoc/source/corereflection/crefl.cxx b/stoc/source/corereflection/crefl.cxx index 20629ad56..29a471034 100644 --- a/stoc/source/corereflection/crefl.cxx +++ b/stoc/source/corereflection/crefl.cxx @@ -62,33 +62,14 @@ static rtl_StandardModuleCount g_moduleCount = MODULE_COUNT_INIT; static Sequence< OUString > core_getSupportedServiceNames() { - static Sequence < OUString > *pNames = 0; - if( ! pNames ) - { - MutexGuard guard( Mutex::getGlobalMutex() ); - if( !pNames ) - { - static Sequence< OUString > seqNames(1); - seqNames.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM(SERVICENAME) ); - pNames = &seqNames; - } - } - return *pNames; + Sequence< OUString > seqNames(1); + seqNames.getArray()[0] = OUString( RTL_CONSTASCII_USTRINGPARAM(SERVICENAME) ); + return seqNames; } static OUString core_getImplementationName() { - static OUString *pImplName = 0; - if( ! pImplName ) - { - MutexGuard guard( Mutex::getGlobalMutex() ); - if( ! pImplName ) - { - static OUString implName( RTL_CONSTASCII_USTRINGPARAM( IMPLNAME ) ); - pImplName = &implName; - } - } - return *pImplName; + return OUString(RTL_CONSTASCII_USTRINGPARAM(IMPLNAME)); } //__________________________________________________________________________________________________ IdlReflectionServiceImpl::IdlReflectionServiceImpl( diff --git a/stoc/source/defaultregistry/defaultregistry.cxx b/stoc/source/defaultregistry/defaultregistry.cxx index 6bb90285a..5ab668405 100644 --- a/stoc/source/defaultregistry/defaultregistry.cxx +++ b/stoc/source/defaultregistry/defaultregistry.cxx @@ -66,33 +66,14 @@ namespace stoc_bootstrap { Sequence< OUString > defreg_getSupportedServiceNames() { - static Sequence < OUString > *pNames = 0; - if( ! pNames ) - { - MutexGuard guard( Mutex::getGlobalMutex() ); - if( !pNames ) - { - static Sequence< OUString > seqNames(1); - seqNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM(SERVICENAME)); - pNames = &seqNames; - } - } - return *pNames; + Sequence< OUString > seqNames(1); + seqNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM(SERVICENAME)); + return seqNames; } OUString defreg_getImplementationName() { - static OUString *pImplName = 0; - if( ! pImplName ) - { - MutexGuard guard( Mutex::getGlobalMutex() ); - if( ! pImplName ) - { - static OUString implName( RTL_CONSTASCII_USTRINGPARAM( IMPLNAME ) ); - pImplName = &implName; - } - } - return *pImplName; + return OUString(RTL_CONSTASCII_USTRINGPARAM(IMPLNAME)); } } diff --git a/stoc/source/implementationregistration/implreg.cxx b/stoc/source/implementationregistration/implreg.cxx index 008999284..485b9c293 100644 --- a/stoc/source/implementationregistration/implreg.cxx +++ b/stoc/source/implementationregistration/implreg.cxx @@ -141,18 +141,9 @@ namespace stoc_bootstrap { Sequence< OUString > impreg_getSupportedServiceNames() { - static Sequence < OUString > *pNames = 0; - if( ! pNames ) - { - MutexGuard guard( Mutex::getGlobalMutex() ); - if( !pNames ) - { - static Sequence< OUString > seqNames(1); - seqNames.getArray()[0] = stoc_impreg::spool().sServiceName; - pNames = &seqNames; - } - } - return *pNames; + Sequence< OUString > seqNames(1); + seqNames.getArray()[0] = stoc_impreg::spool().sServiceName; + return seqNames; } OUString impreg_getImplementationName() diff --git a/stoc/source/invocation/invocation.cxx b/stoc/source/invocation/invocation.cxx index a1a853dce..ca9731b75 100644 --- a/stoc/source/invocation/invocation.cxx +++ b/stoc/source/invocation/invocation.cxx @@ -82,33 +82,14 @@ static rtl_StandardModuleCount g_moduleCount = MODULE_COUNT_INIT; static Sequence< OUString > inv_getSupportedServiceNames() { - static Sequence < OUString > *pNames = 0; - if( ! pNames ) - { - MutexGuard guard( Mutex::getGlobalMutex() ); - if( !pNames ) - { - static Sequence< OUString > seqNames(1); - seqNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM(SERVICENAME)); - pNames = &seqNames; - } - } - return *pNames; + Sequence< OUString > seqNames(1); + seqNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM(SERVICENAME)); + return seqNames; } static OUString inv_getImplementationName() { - static OUString *pImplName = 0; - if( ! pImplName ) - { - MutexGuard guard( Mutex::getGlobalMutex() ); - if( ! pImplName ) - { - static OUString implName( RTL_CONSTASCII_USTRINGPARAM( IMPLNAME ) ); - pImplName = &implName; - } - } - return *pImplName; + return OUString(RTL_CONSTASCII_USTRINGPARAM(IMPLNAME)); } // TODO: Zentral implementieren diff --git a/stoc/source/invocation_adapterfactory/iafactory.cxx b/stoc/source/invocation_adapterfactory/iafactory.cxx index e891b639a..c315709d1 100644 --- a/stoc/source/invocation_adapterfactory/iafactory.cxx +++ b/stoc/source/invocation_adapterfactory/iafactory.cxx @@ -76,34 +76,15 @@ static rtl_StandardModuleCount g_moduleCount = MODULE_COUNT_INIT; static Sequence< OUString > invadp_getSupportedServiceNames() { - static Sequence < OUString > *pNames = 0; - if( ! pNames ) - { - MutexGuard guard( Mutex::getGlobalMutex() ); - if( !pNames ) - { - static Sequence< OUString > seqNames(1); - seqNames.getArray()[0] = - OUString(RTL_CONSTASCII_USTRINGPARAM(SERVICENAME)); - pNames = &seqNames; - } - } - return *pNames; + Sequence< OUString > seqNames(1); + seqNames.getArray()[0] = + OUString(RTL_CONSTASCII_USTRINGPARAM(SERVICENAME)); + return seqNames; } static OUString invadp_getImplementationName() { - static OUString *pImplName = 0; - if( ! pImplName ) - { - MutexGuard guard( Mutex::getGlobalMutex() ); - if( ! pImplName ) - { - static OUString implName( RTL_CONSTASCII_USTRINGPARAM( IMPLNAME ) ); - pImplName = &implName; - } - } - return *pImplName; + return OUString(RTL_CONSTASCII_USTRINGPARAM(IMPLNAME)); } struct hash_ptr diff --git a/stoc/source/javaloader/javaloader.cxx b/stoc/source/javaloader/javaloader.cxx index 2c178e273..22452aca1 100644 --- a/stoc/source/javaloader/javaloader.cxx +++ b/stoc/source/javaloader/javaloader.cxx @@ -86,37 +86,18 @@ static Mutex & getInitMutex(); static Sequence< OUString > loader_getSupportedServiceNames() { - static Sequence < OUString > *pNames = 0; - if( ! pNames ) - { - MutexGuard guard( Mutex::getGlobalMutex() ); - if( !pNames ) - { - static Sequence< OUString > seqNames(2); - seqNames.getArray()[0] = OUString( - RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.loader.Java") ); - seqNames.getArray()[1] = OUString( - RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.loader.Java2") ); - pNames = &seqNames; - } - } - return *pNames; + Sequence< OUString > seqNames(2); + seqNames.getArray()[0] = OUString( + RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.loader.Java") ); + seqNames.getArray()[1] = OUString( + RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.loader.Java2") ); + return seqNames; } static OUString loader_getImplementationName() { - static OUString *pImplName = 0; - if( ! pImplName ) - { - MutexGuard guard( Mutex::getGlobalMutex() ); - if( ! pImplName ) - { - static OUString implName( - RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.stoc.JavaComponentLoader" ) ); - pImplName = &implName; - } - } - return *pImplName; + return OUString( + RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.stoc.JavaComponentLoader" ) ); } class JavaComponentLoader : public WeakImplHelper2<XImplementationLoader, XServiceInfo> diff --git a/stoc/source/loader/dllcomponentloader.cxx b/stoc/source/loader/dllcomponentloader.cxx index 215b0a99a..78aca34d3 100644 --- a/stoc/source/loader/dllcomponentloader.cxx +++ b/stoc/source/loader/dllcomponentloader.cxx @@ -73,33 +73,14 @@ namespace stoc_bootstrap { Sequence< OUString > loader_getSupportedServiceNames() { - static Sequence < OUString > *pNames = 0; - if( ! pNames ) - { - MutexGuard guard( Mutex::getGlobalMutex() ); - if( !pNames ) - { - static Sequence< OUString > seqNames(1); - seqNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM(SERVICENAME)); - pNames = &seqNames; - } - } - return *pNames; + Sequence< OUString > seqNames(1); + seqNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM(SERVICENAME)); + return seqNames; } OUString loader_getImplementationName() { - static OUString *pImplName = 0; - if( ! pImplName ) - { - MutexGuard guard( Mutex::getGlobalMutex() ); - if( ! pImplName ) - { - static OUString implName( RTL_CONSTASCII_USTRINGPARAM( IMPLNAME ) ); - pImplName = &implName; - } - } - return *pImplName; + return OUString(RTL_CONSTASCII_USTRINGPARAM(IMPLNAME)); } } diff --git a/stoc/source/namingservice/namingservice.cxx b/stoc/source/namingservice/namingservice.cxx index 5165d92a2..39e1528ed 100644 --- a/stoc/source/namingservice/namingservice.cxx +++ b/stoc/source/namingservice/namingservice.cxx @@ -63,33 +63,14 @@ static rtl_StandardModuleCount g_moduleCount = MODULE_COUNT_INIT; static Sequence< OUString > ns_getSupportedServiceNames() { - static Sequence < OUString > *pNames = 0; - if( ! pNames ) - { - MutexGuard guard( Mutex::getGlobalMutex() ); - if( !pNames ) - { - static Sequence< OUString > seqNames(1); - seqNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM(SERVICENAME)); - pNames = &seqNames; - } - } - return *pNames; + Sequence< OUString > seqNames(1); + seqNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM(SERVICENAME)); + return seqNames; } static OUString ns_getImplementationName() { - static OUString *pImplName = 0; - if( ! pImplName ) - { - MutexGuard guard( Mutex::getGlobalMutex() ); - if( ! pImplName ) - { - static OUString implName( RTL_CONSTASCII_USTRINGPARAM( IMPLNAME ) ); - pImplName = &implName; - } - } - return *pImplName; + return OUString(RTL_CONSTASCII_USTRINGPARAM(IMPLNAME)); } struct equalOWString_Impl diff --git a/stoc/source/registry_tdprovider/tdprovider.cxx b/stoc/source/registry_tdprovider/tdprovider.cxx index 0f7908101..6c0ef2cc0 100644 --- a/stoc/source/registry_tdprovider/tdprovider.cxx +++ b/stoc/source/registry_tdprovider/tdprovider.cxx @@ -68,33 +68,14 @@ namespace stoc_bootstrap { uno::Sequence< OUString > rdbtdp_getSupportedServiceNames() { - static Sequence < OUString > *pNames = 0; - if( ! pNames ) - { - MutexGuard guard( Mutex::getGlobalMutex() ); - if( !pNames ) - { - static Sequence< OUString > seqNames(1); - seqNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM(SERVICENAME)); - pNames = &seqNames; - } - } - return *pNames; + Sequence< OUString > seqNames(1); + seqNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM(SERVICENAME)); + return seqNames; } OUString rdbtdp_getImplementationName() { - static OUString *pImplName = 0; - if( ! pImplName ) - { - MutexGuard guard( Mutex::getGlobalMutex() ); - if( ! pImplName ) - { - static OUString implName( RTL_CONSTASCII_USTRINGPARAM( IMPLNAME ) ); - pImplName = &implName; - } - } - return *pImplName; + return OUString(RTL_CONSTASCII_USTRINGPARAM(IMPLNAME)); } } diff --git a/stoc/source/security/access_controller.cxx b/stoc/source/security/access_controller.cxx index 405546c84..b42ab0efb 100644 --- a/stoc/source/security/access_controller.cxx +++ b/stoc/source/security/access_controller.cxx @@ -1043,9 +1043,9 @@ Reference< XInterface > SAL_CALL ac_create( //-------------------------------------------------------------------------------------------------- Sequence< OUString > ac_getSupportedServiceNames() SAL_THROW( () ) { - static OUString s_serviceName = OUSTR(SERVICE_NAME); - static Sequence< OUString > s_serviceNames = Sequence< OUString >( &s_serviceName, 1 ); - return s_serviceNames; + Sequence< OUString > aSNS( 1 ); + aSNS.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM(SERVICE_NAME)); + return aSNS; } //-------------------------------------------------------------------------------------------------- OUString ac_getImplementationName() SAL_THROW( () ) diff --git a/stoc/source/security/file_policy.cxx b/stoc/source/security/file_policy.cxx index 1288881a9..109fecc0b 100644 --- a/stoc/source/security/file_policy.cxx +++ b/stoc/source/security/file_policy.cxx @@ -589,9 +589,9 @@ Reference< XInterface > SAL_CALL filepolicy_create( //-------------------------------------------------------------------------------------------------- Sequence< OUString > filepolicy_getSupportedServiceNames() SAL_THROW( () ) { - static OUString s_serviceName = OUSTR(SERVICE_NAME); - static Sequence< OUString > s_serviceNames = Sequence< OUString >( &s_serviceName, 1 ); - return s_serviceNames; + Sequence< OUString > aSNS( 1 ); + aSNS.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM(SERVICE_NAME)); + return aSNS; } //-------------------------------------------------------------------------------------------------- OUString filepolicy_getImplementationName() SAL_THROW( () ) diff --git a/stoc/source/tdmanager/tdmgr.cxx b/stoc/source/tdmanager/tdmgr.cxx index 235175143..6366818fe 100644 --- a/stoc/source/tdmanager/tdmgr.cxx +++ b/stoc/source/tdmanager/tdmgr.cxx @@ -86,33 +86,14 @@ namespace stoc_bootstrap { Sequence< OUString > SAL_CALL tdmgr_getSupportedServiceNames() { - static Sequence < OUString > *pNames = 0; - if( ! pNames ) - { - MutexGuard guard( Mutex::getGlobalMutex() ); - if( !pNames ) - { - static Sequence< OUString > seqNames(1); - seqNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM(SERVICENAME)); - pNames = &seqNames; - } - } - return *pNames; + Sequence< OUString > seqNames(1); + seqNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM(SERVICENAME)); + return seqNames; } OUString SAL_CALL tdmgr_getImplementationName() { - static OUString *pImplName = 0; - if( ! pImplName ) - { - MutexGuard guard( Mutex::getGlobalMutex() ); - if( ! pImplName ) - { - static OUString implName( RTL_CONSTASCII_USTRINGPARAM( IMPLNAME ) ); - pImplName = &implName; - } - } - return *pImplName; + return OUString(RTL_CONSTASCII_USTRINGPARAM(IMPLNAME)); } } diff --git a/stoc/source/typeconv/convert.cxx b/stoc/source/typeconv/convert.cxx index b57208604..9d07c1faf 100644 --- a/stoc/source/typeconv/convert.cxx +++ b/stoc/source/typeconv/convert.cxx @@ -68,33 +68,14 @@ namespace stoc_services { Sequence< OUString > tcv_getSupportedServiceNames() { - static Sequence < OUString > *pNames = 0; - if( ! pNames ) - { - MutexGuard guard( Mutex::getGlobalMutex() ); - if( !pNames ) - { - static Sequence< OUString > seqNames(1); - seqNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM(SERVICENAME)); - pNames = &seqNames; - } - } - return *pNames; + Sequence< OUString > seqNames(1); + seqNames.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM(SERVICENAME)); + return seqNames; } OUString tcv_getImplementationName() { - static OUString *pImplName = 0; - if( ! pImplName ) - { - MutexGuard guard( Mutex::getGlobalMutex() ); - if( ! pImplName ) - { - static OUString implName( RTL_CONSTASCII_USTRINGPARAM( IMPLNAME ) ); - pImplName = &implName; - } - } - return *pImplName; + return OUString(RTL_CONSTASCII_USTRINGPARAM(IMPLNAME)); } } |