diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-05-16 23:54:14 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-05-17 14:03:25 +0100 |
commit | 0e9c60d5964e27d0ff5b48edcb23b340e9a0233b (patch) | |
tree | ea47e8ec080c2b84dbdae92f17099b2fff51c565 | |
parent | 1d0f8a1bfb295ee8871267c6af8d5a2836e97ae9 (diff) |
reduce static_initialization_and_destruction chain
Change-Id: Ib2642e19d9148acca27227b0d91de4e8855178aa
-rw-r--r-- | comphelper/source/misc/locale.cxx | 15 | ||||
-rw-r--r-- | filter/source/config/cache/configflush.cxx | 3 | ||||
-rw-r--r-- | filter/source/config/cache/filtercache.cxx | 14 |
3 files changed, 11 insertions, 21 deletions
diff --git a/comphelper/source/misc/locale.cxx b/comphelper/source/misc/locale.cxx index 6ed05bcc113d..aef1a3dc36fe 100644 --- a/comphelper/source/misc/locale.cxx +++ b/comphelper/source/misc/locale.cxx @@ -45,28 +45,19 @@ const sal_Unicode Locale::SEPERATOR_CV_LINUX = (sal_Unicode)'.'; //----------------------------------------------- const Locale Locale::X_DEFAULT() { - static Locale aLocale( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("x")), - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("default"))); - return aLocale; + return Locale(::rtl::OUString("x"), ::rtl::OUString("default")); } //----------------------------------------------- const Locale Locale::EN_US() { - static Locale aLocale( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en")), - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("US"))); - return aLocale; + return Locale(::rtl::OUString("en"), ::rtl::OUString("US")); } //----------------------------------------------- const Locale Locale::X_NOTRANSLATE() { - static Locale aLocale( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("x")), - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("notranslate"))); - return aLocale; + return Locale(::rtl::OUString("x"), ::rtl::OUString("notranslate")); } //----------------------------------------------- diff --git a/filter/source/config/cache/configflush.cxx b/filter/source/config/cache/configflush.cxx index 5e8a17e86da6..b1c5027e392c 100644 --- a/filter/source/config/cache/configflush.cxx +++ b/filter/source/config/cache/configflush.cxx @@ -144,8 +144,7 @@ void SAL_CALL ConfigFlush::removeRefreshListener(const css::uno::Reference< css: //----------------------------------------------- ::rtl::OUString ConfigFlush::impl_getImplementationName() { - static ::rtl::OUString IMPLNAME( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.filter.config.ConfigFlush" )); - return IMPLNAME; + return ::rtl::OUString("com.sun.star.comp.filter.config.ConfigFlush"); } //----------------------------------------------- diff --git a/filter/source/config/cache/filtercache.cxx b/filter/source/config/cache/filtercache.cxx index 1da6f142bc38..e6e1e4fd6b9c 100644 --- a/filter/source/config/cache/filtercache.cxx +++ b/filter/source/config/cache/filtercache.cxx @@ -1632,8 +1632,6 @@ void FilterCache::impl_readPatchUINames(const css::uno::Reference< css::containe CacheItem& rItem) throw(css::uno::Exception) { - static ::rtl::OUString FORMATNAME_VAR( RTL_CONSTASCII_USTRINGPARAM( "%productname%" )); - static ::rtl::OUString FORMATVERSION_VAR( RTL_CONSTASCII_USTRINGPARAM( "%formatversion%" )); // SAFE -> ---------------------------------- ::osl::ResettableMutexGuard aLock(m_aLock); @@ -1652,6 +1650,8 @@ void FilterCache::impl_readPatchUINames(const css::uno::Reference< css::containe ::comphelper::SequenceAsVector< ::rtl::OUString >::const_iterator pLocale ; ::comphelper::SequenceAsHashMap lUINames; + const char FORMATNAME_VAR[] = "%productname%"; + const char FORMATVERSION_VAR[] = "%formatversion%"; // patch %PRODUCTNAME and %FORMATNAME for ( pLocale = lLocales.begin(); pLocale != lLocales.end() ; @@ -1666,14 +1666,14 @@ void FilterCache::impl_readPatchUINames(const css::uno::Reference< css::containe sal_Int32 nIndex = sValue.indexOf(FORMATNAME_VAR); while(nIndex != -1) { - sValue = sValue.replaceAt(nIndex, FORMATNAME_VAR.getLength(), sFormatName); + sValue = sValue.replaceAt(nIndex, RTL_CONSTASCII_LENGTH(FORMATNAME_VAR), sFormatName); nIndex = sValue.indexOf(FORMATNAME_VAR, nIndex); } // replace %formatversion% nIndex = sValue.indexOf(FORMATVERSION_VAR); while(nIndex != -1) { - sValue = sValue.replaceAt(nIndex, FORMATVERSION_VAR.getLength(), sFormatVersion); + sValue = sValue.replaceAt(nIndex, RTL_CONSTASCII_LENGTH(FORMATVERSION_VAR), sFormatVersion); nIndex = sValue.indexOf(FORMATVERSION_VAR, nIndex); } @@ -2298,9 +2298,6 @@ void FilterCache::impl_interpretDataVal4Filter(const ::rtl::OUString& sValue, void FilterCache::impl_readOldFormat() throw(css::uno::Exception) { - static ::rtl::OUString TYPES_SET( RTL_CONSTASCII_USTRINGPARAM( "Types" )); - static ::rtl::OUString FILTER_SET( RTL_CONSTASCII_USTRINGPARAM( "Filters" )); - // Attention: Opening/Reading of this old configuration format has to be handled gracefully. // Its optional and shouldnt disturb our normal work! // E.g. we must check, if the package exists ... @@ -2318,6 +2315,8 @@ void FilterCache::impl_readOldFormat() catch(const css::uno::Exception&) { return; } + ::rtl::OUString TYPES_SET("Types"); + // May be there is no type set ... if (xCfg->hasByName(TYPES_SET)) { @@ -2329,6 +2328,7 @@ void FilterCache::impl_readOldFormat() m_lTypes[pItems[i]] = impl_readOldItem(xSet, E_TYPE, pItems[i]); } + ::rtl::OUString FILTER_SET("Filters"); // May be there is no filter set ... if (xCfg->hasByName(FILTER_SET)) { |