From 5e60674857d3d290f172b8c133c69aeba003b1ce Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Thu, 11 Jul 2013 19:14:32 +0200 Subject: use LanguageTag to convert Change-Id: I11007c31e5b4eea39ce27876de8a65fbf563a5e9 --- unotools/source/config/fontcfg.cxx | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'unotools') 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]; } -- cgit