diff options
author | Hans-Joachim Lankenau <hjs@openoffice.org> | 2004-06-25 16:07:28 +0000 |
---|---|---|
committer | Hans-Joachim Lankenau <hjs@openoffice.org> | 2004-06-25 16:07:28 +0000 |
commit | c2ea3b2694f281e8895f48dac3f2db3a72d65175 (patch) | |
tree | 4990111703c53a5ffdb9b0881541dccae82e2d22 /unotools/source/config | |
parent | 3871c47dcb37f2b0159add0960d15087da835ca2 (diff) |
INTEGRATION: CWS tune04 (1.37.10); FILE MERGED
2004/06/14 09:53:03 cmc 1.37.10.1: #i29636# turn global objects into local static data protected with swishy double-locked templated template
Diffstat (limited to 'unotools/source/config')
-rw-r--r-- | unotools/source/config/configmgr.cxx | 50 |
1 files changed, 32 insertions, 18 deletions
diff --git a/unotools/source/config/configmgr.cxx b/unotools/source/config/configmgr.cxx index e6c5ee21f72a..1ae64a19b82a 100644 --- a/unotools/source/config/configmgr.cxx +++ b/unotools/source/config/configmgr.cxx @@ -2,9 +2,9 @@ * * $RCSfile: configmgr.cxx,v $ * - * $Revision: 1.37 $ + * $Revision: 1.38 $ * - * last change: $Author: hr $ $Date: 2004-05-10 14:18:38 $ + * last change: $Author: hjs $ $Date: 2004-06-25 17:07:28 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -89,6 +89,9 @@ #ifndef _OSL_DIAGNOSE_H_ #include <osl/diagnose.h> #endif +#ifndef INCLUDED_RTL_INSTANCE_HXX +#include <rtl/instance.hxx> +#endif #include <list> @@ -107,10 +110,17 @@ const char* cConfigBaseURL = "/org.openoffice."; //const char* cConfigBaseURL = "/com.sun.star."; const char* cAccessSrvc = "com.sun.star.configuration.ConfigurationUpdateAccess"; -static ::rtl::OUString aBrandName; -static ::rtl::OUString aProductVersion; -static ::rtl::OUString aProductExtension; -static ::rtl::OUString aXMLFileFormatVersion; +namespace +{ + struct BrandName + : public rtl::Static< ::rtl::OUString, BrandName > {}; + struct ProductVersion + : public rtl::Static< ::rtl::OUString, ProductVersion > {}; + struct ProductExtension + : public rtl::Static< ::rtl::OUString, ProductExtension > {}; + struct XMLFileFormatVersion + : public rtl::Static< ::rtl::OUString, XMLFileFormatVersion > {}; +} //----------------------------------------------------------------------------- struct ConfigItemListEntry_Impl @@ -439,27 +449,31 @@ Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp) ConfigManager * pTheConfigManager = GetConfigManager(); Any aRet; - if ( eProp == PRODUCTNAME && aBrandName.getLength() ) + ::rtl::OUString &rBrandName = BrandName::get(); + if ( eProp == PRODUCTNAME && rBrandName.getLength() ) { - aRet <<= aBrandName; + aRet <<= rBrandName; return aRet; } - if ( eProp == PRODUCTVERSION && aProductVersion.getLength() ) + rtl::OUString &rProductVersion = ProductVersion::get(); + if ( eProp == PRODUCTVERSION && rProductVersion.getLength() ) { - aRet <<= aProductVersion; + aRet <<= rProductVersion; return aRet; } - if ( eProp == PRODUCTEXTENSION && aProductExtension.getLength() ) + rtl::OUString &rProductExtension = ProductExtension::get(); + if ( eProp == PRODUCTEXTENSION && rProductExtension.getLength() ) { - aRet <<= aProductExtension; + aRet <<= rProductExtension; return aRet; } - if ( eProp == PRODUCTXMLFILEFORMATVERSION && aXMLFileFormatVersion.getLength() ) + rtl::OUString &rXMLFileFormatVersion = XMLFileFormatVersion::get(); + if ( eProp == PRODUCTXMLFILEFORMATVERSION && rXMLFileFormatVersion.getLength() ) { - aRet <<= aXMLFileFormatVersion; + aRet <<= rXMLFileFormatVersion; return aRet; } @@ -520,16 +534,16 @@ Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp) } if ( eProp == PRODUCTNAME ) - aRet >>= aBrandName; + aRet >>= rBrandName; if ( eProp == PRODUCTXMLFILEFORMATVERSION ) - aRet >>= aXMLFileFormatVersion; + aRet >>= rXMLFileFormatVersion; if ( eProp == PRODUCTVERSION ) - aRet >>= aProductVersion; + aRet >>= rProductVersion; if ( eProp == PRODUCTEXTENSION ) - aRet >>= aProductExtension; + aRet >>= rProductExtension; return aRet; } |