diff options
author | Eike Rathke <erack@redhat.com> | 2013-07-13 02:54:05 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-07-13 11:55:16 +0200 |
commit | 358d1a99484bcc02900bd200a7606a7bf3298cac (patch) | |
tree | 031f808141dbc712553b8a4a029a354a2699a622 /unotools/source/config | |
parent | 5d1a8e0d47b6d6e9e3e5735d0ee52fa0b4782202 (diff) |
use static LanguageTag::convertTo...() for standalone conversions
If no LanguageTag instance is at hand use the static methods to convert
between BCP 47 string, Locale and MS-LangID instead of creating
temporary instances.
Change-Id: I9597f768078eb81c840e84a5db5617f26bb7dc09
Diffstat (limited to 'unotools/source/config')
-rw-r--r-- | unotools/source/config/lingucfg.cxx | 12 | ||||
-rw-r--r-- | unotools/source/config/syslocaleoptions.cxx | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx index a48e018a2e81..5adef3068dd6 100644 --- a/unotools/source/config/lingucfg.cxx +++ b/unotools/source/config/lingucfg.cxx @@ -60,7 +60,7 @@ static sal_Bool lcl_SetLocale( sal_Int16 &rLanguage, const uno::Any &rVal ) lang::Locale aNew; if (rVal >>= aNew) // conversion successful? { - sal_Int16 nNew = LanguageTag( aNew ).getLanguageType( false); + sal_Int16 nNew = LanguageTag::convertToLanguageType( aNew, false); if (nNew != rLanguage) { rLanguage = nNew; @@ -74,7 +74,7 @@ static inline const OUString lcl_LanguageToCfgLocaleStr( sal_Int16 nLanguage ) { OUString aRes; if (LANGUAGE_SYSTEM != nLanguage) - aRes = LanguageTag( nLanguage ).getBcp47(); + aRes = LanguageTag::convertToBcp47( nLanguage ); return aRes; } @@ -82,7 +82,7 @@ static sal_Int16 lcl_CfgAnyToLanguage( const uno::Any &rVal ) { OUString aTmp; rVal >>= aTmp; - return (aTmp.isEmpty()) ? LANGUAGE_SYSTEM : LanguageTag( aTmp ).getLanguageType(); + return (aTmp.isEmpty()) ? LANGUAGE_SYSTEM : LanguageTag::convertToLanguageType( aTmp ); } SvtLinguOptions::SvtLinguOptions() @@ -364,19 +364,19 @@ uno::Any SvtLinguConfigItem::GetProperty( sal_Int32 nPropertyHandle ) const } case UPH_DEFAULT_LOCALE : { - lang::Locale aLocale( LanguageTag( rOpt.nDefaultLanguage ).getLocale( false ) ); + lang::Locale aLocale( LanguageTag::convertToLocale( rOpt.nDefaultLanguage, false) ); aRes.setValue( &aLocale, ::getCppuType((lang::Locale*)0 )); break; } case UPH_DEFAULT_LOCALE_CJK : { - lang::Locale aLocale( LanguageTag( rOpt.nDefaultLanguage_CJK ).getLocale( false ) ); + lang::Locale aLocale( LanguageTag::convertToLocale( rOpt.nDefaultLanguage_CJK, false) ); aRes.setValue( &aLocale, ::getCppuType((lang::Locale*)0 )); break; } case UPH_DEFAULT_LOCALE_CTL : { - lang::Locale aLocale( LanguageTag( rOpt.nDefaultLanguage_CTL ).getLocale( false ) ); + lang::Locale aLocale( LanguageTag::convertToLocale( rOpt.nDefaultLanguage_CTL, false) ); aRes.setValue( &aLocale, ::getCppuType((lang::Locale*)0 )); break; } diff --git a/unotools/source/config/syslocaleoptions.cxx b/unotools/source/config/syslocaleoptions.cxx index 31879c400496..fbab88b34d91 100644 --- a/unotools/source/config/syslocaleoptions.cxx +++ b/unotools/source/config/syslocaleoptions.cxx @@ -676,7 +676,7 @@ void SvtSysLocaleOptions::GetCurrencyAbbrevAndLanguage( OUString& rAbbrev, { rAbbrev = rConfigString.copy( 0, nDelim ); OUString aIsoStr( rConfigString.copy( nDelim+1 ) ); - eLang = LanguageTag( aIsoStr ).getLanguageType(); + eLang = LanguageTag::convertToLanguageType( aIsoStr ); } else { @@ -690,7 +690,7 @@ void SvtSysLocaleOptions::GetCurrencyAbbrevAndLanguage( OUString& rAbbrev, OUString SvtSysLocaleOptions::CreateCurrencyConfigString( const OUString& rAbbrev, LanguageType eLang ) { - OUString aIsoStr( LanguageTag( eLang ).getBcp47() ); + OUString aIsoStr( LanguageTag::convertToBcp47( eLang ) ); if ( !aIsoStr.isEmpty() ) { OUStringBuffer aStr( rAbbrev.getLength() + 1 + aIsoStr.getLength() ); |