diff options
author | Eike Rathke <erack@redhat.com> | 2012-11-16 18:55:33 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2012-11-16 19:02:46 +0100 |
commit | ec2e175384f89d183def1d53f33a6bb394278c87 (patch) | |
tree | 454410e290dfdd9a8c46a421d4f4ce6a63e16589 | |
parent | 3eb4304af99265c898835cd307ba7d689038996b (diff) |
use LanguageTag
Change-Id: I568af42912ce1ec7701dc0043dfbd9d69243d533
-rw-r--r-- | xmloff/source/style/xmlnumfe.cxx | 15 | ||||
-rw-r--r-- | xmloff/source/style/xmlnumfi.cxx | 12 |
2 files changed, 14 insertions, 13 deletions
diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx index 295b2c96150d..a2f85a499386 100644 --- a/xmloff/source/style/xmlnumfe.cxx +++ b/xmloff/source/style/xmlnumfe.cxx @@ -22,6 +22,7 @@ #include <svl/zformat.hxx> #include <svl/numuno.hxx> #include <i18npool/mslangid.hxx> +#include <i18npool/languagetag.hxx> #include <tools/debug.hxx> #include <rtl/math.hxx> #include <unotools/calendarwrapper.hxx> @@ -243,7 +244,7 @@ SvXMLNumFmtExport::SvXMLNumFmtExport( } else { - lang::Locale aLocale( MsLangId::convertLanguageToLocale( MsLangId::getSystemLanguage() ) ); + lang::Locale aLocale( LanguageTag( MsLangId::getSystemLanguage() ).getLocale() ); pCharClass = new CharClass( comphelper::getComponentContext(rExport.getServiceFactory()), aLocale ); pLocaleData = new LocaleDataWrapper( comphelper::getComponentContext(rExport.getServiceFactory()), aLocale ); @@ -278,7 +279,7 @@ SvXMLNumFmtExport::SvXMLNumFmtExport( } else { - lang::Locale aLocale( MsLangId::convertLanguageToLocale( MsLangId::getSystemLanguage() ) ); + lang::Locale aLocale( LanguageTag( MsLangId::getSystemLanguage() ).getLocale() ); pCharClass = new CharClass( comphelper::getComponentContext(rExport.getServiceFactory()), aLocale ); pLocaleData = new LocaleDataWrapper( comphelper::getComponentContext(rExport.getServiceFactory()), aLocale ); @@ -342,7 +343,7 @@ void SvXMLNumFmtExport::AddLanguageAttr_Impl( sal_Int32 nLang ) if ( nLang != LANGUAGE_SYSTEM ) { OUString aLangStr, aCountryStr; - MsLangId::convertLanguageToIsoNames( (LanguageType)nLang, aLangStr, aCountryStr ); + LanguageTag( (LanguageType)nLang ).getIsoLanguageCountry( aLangStr, aCountryStr ); if (!aLangStr.isEmpty()) rExport.AddAttribute( XML_NAMESPACE_NUMBER, XML_LANGUAGE, aLangStr ); @@ -798,7 +799,7 @@ sal_Bool SvXMLNumFmtExport::WriteTextWithCurrency_Impl( const OUString& rString, sal_Bool bRet = sal_False; - LanguageType nLang = MsLangId::convertLocaleToLanguage( rLocale ); + LanguageType nLang = LanguageTag( rLocale ).getLanguageType( false); pFormatter->ChangeIntl( nLang ); String sCurString, sDummy; pFormatter->GetCompatibilityCurrency( sCurString, sDummy ); @@ -841,7 +842,7 @@ static OUString lcl_GetDefaultCalendar( SvNumberFormatter* pFormatter, LanguageT CalendarWrapper* pCalendar = pFormatter->GetCalendar(); if (pCalendar) { - lang::Locale aLocale( MsLangId::convertLanguageToLocale( nLang ) ); + lang::Locale aLocale( LanguageTag( nLang ).getLocale() ); uno::Sequence<OUString> aCals = pCalendar->getAllCalendars( aLocale ); sal_Int32 nCnt = aCals.getLength(); @@ -1311,7 +1312,7 @@ void SvXMLNumFmtExport::ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt // automatic currency symbol is implemented as part of // normal text -> search for the symbol bCurrencyWritten = WriteTextWithCurrency_Impl( *pElemStr, - MsLangId::convertLanguageToLocale( nLang ) ); + LanguageTag( nLang ).getLocale() ); bAnyContent = sal_True; } else @@ -1486,7 +1487,7 @@ void SvXMLNumFmtExport::ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt if ( nElemType == NF_KEY_NNNN ) { // write additional text element for separator - pLocaleData->setLocale( MsLangId::convertLanguageToLocale( nLang ) ); + pLocaleData->setLocale( LanguageTag( nLang ).getLocale() ); AddToTextElement_Impl( pLocaleData->getLongDateDayOfWeekSep() ); } } diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx index abfbc361fae0..f5b8c2124fab 100644 --- a/xmloff/source/style/xmlnumfi.cxx +++ b/xmloff/source/style/xmlnumfi.cxx @@ -26,7 +26,7 @@ #include <svl/zformat.hxx> #include <svl/numuno.hxx> #include <rtl/math.hxx> -#include <i18npool/mslangid.hxx> +#include <i18npool/languagetag.hxx> #include <tools/color.hxx> #include <tools/debug.hxx> #include <rtl/ustrbuf.hxx> @@ -602,9 +602,9 @@ const LocaleDataWrapper& SvXMLNumImpData::GetLocaleData( LanguageType nLang ) pLocaleData = new LocaleDataWrapper( comphelper::getComponentContext( pFormatter ? pFormatter->GetServiceManager() : mxServiceFactory), - MsLangId::convertLanguageToLocale( nLang ) ); + LanguageTag( nLang ).getLocale() ); else - pLocaleData->setLocale( MsLangId::convertLanguageToLocale( nLang ) ); + pLocaleData->setLocale( LanguageTag( nLang ).getLocale() ); return *pLocaleData; } @@ -1009,7 +1009,7 @@ SvXMLNumFmtElementContext::SvXMLNumFmtElementContext( SvXMLImport& rImport, if ( !sLanguage.isEmpty() || !sCountry.isEmpty() ) { - nElementLang = MsLangId::convertIsoNamesToLanguage( sLanguage, sCountry ); + nElementLang = LanguageTag( sLanguage, sCountry ).getLanguageType( false); if ( nElementLang == LANGUAGE_DONTKNOW ) nElementLang = LANGUAGE_SYSTEM; //! error handling for invalid locales? } @@ -1369,7 +1369,7 @@ SvXMLNumFormatContext::SvXMLNumFormatContext( SvXMLImport& rImport, if ( !sLanguage.isEmpty() || !sCountry.isEmpty() ) { - nFormatLang = MsLangId::convertIsoNamesToLanguage( sLanguage, sCountry ); + nFormatLang = LanguageTag( sLanguage, sCountry ).getLanguageType( false); if ( nFormatLang == LANGUAGE_DONTKNOW ) nFormatLang = LANGUAGE_SYSTEM; //! error handling for invalid locales? } @@ -1383,7 +1383,7 @@ SvXMLNumFormatContext::SvXMLNumFormatContext( SvXMLImport& rImport, aFormatCode.appendAscii( RTL_CONSTASCII_STRINGPARAM( "[NatNum" ) ); aFormatCode.append( nNatNum, 10 ); - LanguageType eLang = MsLangId::convertLocaleToLanguage( aNatNumAttr.Locale ); + LanguageType eLang = LanguageTag( aNatNumAttr.Locale ).getLanguageType( false); if ( eLang == LANGUAGE_DONTKNOW ) eLang = LANGUAGE_SYSTEM; //! error handling for invalid locales? if ( eLang != nFormatLang && eLang != LANGUAGE_SYSTEM ) |