diff options
author | Eike Rathke <erack@redhat.com> | 2012-11-23 23:06:10 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2012-11-23 23:09:16 +0100 |
commit | af60316514f3ae3d4c475819bf86f2af837171e3 (patch) | |
tree | ccfbd673bd4a53047a04dad6457d09c7eea1566c /linguistic | |
parent | 37f5b864014e9ad17a561b77ea9f6141650e92ad (diff) |
some i18n wrappers with LanguageTag
Change-Id: I2ceaa3159e8669c2c569fa8559c1e061dcad399d
Diffstat (limited to 'linguistic')
-rw-r--r-- | linguistic/source/misc.cxx | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx index 53afb419e952..542a82367d01 100644 --- a/linguistic/source/misc.cxx +++ b/linguistic/source/misc.cxx @@ -77,14 +77,12 @@ osl::Mutex & GetLinguMutex() LocaleDataWrapper & GetLocaleDataWrapper( sal_Int16 nLang ) { static LocaleDataWrapper aLclDtaWrp( - CreateLocale( SvtSysLocale().GetLanguageTag().getLanguageType() ) ); - - const Locale &rLcl = aLclDtaWrp.getLoadedLocale(); - Locale aLcl( CreateLocale( nLang ) ); - if (aLcl.Language != rLcl.Language || - aLcl.Country != rLcl.Country || - aLcl.Variant != rLcl.Variant) - aLclDtaWrp.setLocale( aLcl ); + LanguageTag( CreateLocale( SvtSysLocale().GetLanguageTag().getLanguageType() )) ); + + const LanguageTag &rLcl = aLclDtaWrp.getLoadedLanguageTag(); + LanguageTag aLcl( CreateLocale( nLang ) ); + if (aLcl != rLcl) + aLclDtaWrp.setLanguageTag( aLcl ); return aLclDtaWrp; } @@ -600,7 +598,7 @@ uno::Reference< XHyphenatedWord > RebuildHyphensAndControlChars( static CharClass & lcl_GetCharClass() { - static CharClass aCC( CreateLocale( LANGUAGE_ENGLISH_US ) ); + static CharClass aCC( LanguageTag( CreateLocale( LANGUAGE_ENGLISH_US )) ); return aCC; } @@ -617,7 +615,7 @@ sal_Bool IsUpper( const String &rText, xub_StrLen nPos, xub_StrLen nLen, sal_Int MutexGuard aGuard( lcl_GetCharClassMutex() ); CharClass &rCC = lcl_GetCharClass(); - rCC.setLocale( CreateLocale( nLanguage ) ); + rCC.setLanguageTag( LanguageTag( CreateLocale( nLanguage )) ); sal_Int32 nFlags = rCC.getStringType( rText, nPos, nLen ); return (nFlags & KCharacterType::UPPER) && !(nFlags & KCharacterType::LOWER); @@ -629,7 +627,7 @@ String ToLower( const String &rText, sal_Int16 nLanguage ) MutexGuard aGuard( lcl_GetCharClassMutex() ); CharClass &rCC = lcl_GetCharClass(); - rCC.setLocale( CreateLocale( nLanguage ) ); + rCC.setLanguageTag( LanguageTag( CreateLocale( nLanguage )) ); return rCC.lowercase( rText ); } |