diff options
author | Eike Rathke <erack@redhat.com> | 2013-07-11 19:14:32 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-07-11 19:15:53 +0200 |
commit | 5e60674857d3d290f172b8c133c69aeba003b1ce (patch) | |
tree | 121c1becd4a1af01729e6a6488e29bf1073789fb /unotools | |
parent | 0f80c06463e63af9f52501469c0c2090b662ae55 (diff) |
use LanguageTag to convert
Change-Id: I11007c31e5b4eea39ce27876de8a65fbf563a5e9
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/config/fontcfg.cxx | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/unotools/source/config/fontcfg.cxx b/unotools/source/config/fontcfg.cxx index a529bdc9de10..205746d4db19 100644 --- a/unotools/source/config/fontcfg.cxx +++ b/unotools/source/config/fontcfg.cxx @@ -124,19 +124,9 @@ DefaultFontConfiguration::DefaultFontConfiguration() // fill config hash with empty interfaces int nLocales = aLocales.getLength(); const OUString* pLocaleStrings = aLocales.getConstArray(); - Locale aLoc; for( int i = 0; i < nLocales; i++ ) { - sal_Int32 nIndex = 0; - aLoc.Language = pLocaleStrings[i].getToken( 0, sal_Unicode('-'), nIndex ).toAsciiLowerCase(); - if( nIndex != -1 ) - aLoc.Country = pLocaleStrings[i].getToken( 0, sal_Unicode('-'), nIndex ).toAsciiUpperCase(); - else - aLoc.Country = OUString(); - if( nIndex != -1 ) - aLoc.Variant = pLocaleStrings[i].getToken( 0, sal_Unicode('-'), nIndex ).toAsciiUpperCase(); - else - aLoc.Variant = OUString(); + Locale aLoc( LanguageTag( pLocaleStrings[i]).getLocale( false)); m_aConfig[ aLoc ] = LocaleAccess(); m_aConfig[ aLoc ].aConfigLocaleString = pLocaleStrings[i]; } @@ -389,19 +379,9 @@ FontSubstConfiguration::FontSubstConfiguration() : // fill config hash with empty interfaces int nLocales = aLocales.getLength(); const OUString* pLocaleStrings = aLocales.getConstArray(); - Locale aLoc; for( int i = 0; i < nLocales; i++ ) { - sal_Int32 nIndex = 0; - aLoc.Language = pLocaleStrings[i].getToken( 0, sal_Unicode('-'), nIndex ).toAsciiLowerCase(); - if( nIndex != -1 ) - aLoc.Country = pLocaleStrings[i].getToken( 0, sal_Unicode('-'), nIndex ).toAsciiUpperCase(); - else - aLoc.Country = OUString(); - if( nIndex != -1 ) - aLoc.Variant = pLocaleStrings[i].getToken( 0, sal_Unicode('-'), nIndex ).toAsciiUpperCase(); - else - aLoc.Variant = OUString(); + Locale aLoc( LanguageTag( pLocaleStrings[i]).getLocale( false)); m_aSubst[ aLoc ] = LocaleSubst(); m_aSubst[ aLoc ].aConfigLocaleString = pLocaleStrings[i]; } |