From 42455e14477b0923b7f0388c3c8672b0fbf8dfd5 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Sat, 17 Nov 2012 00:27:33 +0100 Subject: use LanguageTag Change-Id: I800638b4e4493988c30470359a78850c4149500b --- .../source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx | 8 +++----- lingucomponent/source/lingutil/lingutil.cxx | 4 ++-- lingucomponent/source/spellcheck/spell/sspellimp.cxx | 8 +++----- lingucomponent/source/thesaurus/libnth/nthesimp.cxx | 8 +++----- 4 files changed, 11 insertions(+), 17 deletions(-) (limited to 'lingucomponent') diff --git a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx index ff2d267719a5..4582a663867a 100644 --- a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx +++ b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx @@ -22,7 +22,7 @@ #include // helper for factories #include -#include +#include #include #include @@ -172,8 +172,7 @@ Sequence< Locale > SAL_CALL Hyphenator::getLocales() k = 0; for (aItB = aLocaleNamesSet.begin(); aItB != aLocaleNamesSet.end(); ++aItB) { - Locale aTmp( MsLangId::convertLanguageToLocale( - MsLangId::convertIsoStringToLanguage( *aItB ))); + Locale aTmp( LanguageTag( *aItB ).getLocale()); aSuppLocales[k++] = aTmp; } @@ -205,8 +204,7 @@ Sequence< Locale > SAL_CALL Hyphenator::getLocales() { aDicts[k].aPtr = NULL; aDicts[k].eEnc = RTL_TEXTENCODING_DONTKNOW; - aDicts[k].aLoc = MsLangId::convertLanguageToLocale( - MsLangId::convertIsoStringToLanguage( aDictIt->aLocaleNames[i] )); + aDicts[k].aLoc = LanguageTag( aDictIt->aLocaleNames[i] ).getLocale(); aDicts[k].apCC = new CharClass( aDicts[k].aLoc ); // also both files have to be in the same directory and the // file names must only differ in the extension (.aff/.dic). diff --git a/lingucomponent/source/lingutil/lingutil.cxx b/lingucomponent/source/lingutil/lingutil.cxx index ca5f34b66b06..5edd78a49ed8 100644 --- a/lingucomponent/source/lingutil/lingutil.cxx +++ b/lingucomponent/source/lingutil/lingutil.cxx @@ -203,7 +203,7 @@ void MergeNewStyleDicsAndOldStyleDics( sal_Int32 nLocaleNames = aLocaleNames.getLength(); for (sal_Int32 k = 0; k < nLocaleNames; ++k) { - LanguageType nLang = MsLangId::convertIsoStringToLanguage( aLocaleNames[k] ); + LanguageType nLang = LanguageTag( aLocaleNames[k] ).getLanguageType(); aNewStyleLanguages.insert( nLang ); } } @@ -219,7 +219,7 @@ void MergeNewStyleDicsAndOldStyleDics( DBG_ASSERT( nOldStyleDics, "old style dictionary with more then one language found!"); if (nOldStyleDics > 0) { - LanguageType nLang = MsLangId::convertIsoStringToLanguage( aIt2->aLocaleNames[0] ); + LanguageType nLang = LanguageTag( aIt2->aLocaleNames[0] ).getLanguageType(); if (nLang == LANGUAGE_DONTKNOW || nLang == LANGUAGE_NONE) { diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx index 94d8fd025a8d..c7d3addb2963 100644 --- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx +++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx @@ -34,7 +34,7 @@ #include #include -#include +#include #include #include #include @@ -168,8 +168,7 @@ Sequence< Locale > SAL_CALL SpellChecker::getLocales() k = 0; for (aItB = aLocaleNamesSet.begin(); aItB != aLocaleNamesSet.end(); ++aItB) { - Locale aTmp( MsLangId::convertLanguageToLocale( - MsLangId::convertIsoStringToLanguage( *aItB ))); + Locale aTmp( LanguageTag( *aItB ).getLocale()); aSuppLocales[k++] = aTmp; } @@ -203,8 +202,7 @@ Sequence< Locale > SAL_CALL SpellChecker::getLocales() { aDicts[k] = NULL; aDEncs[k] = RTL_TEXTENCODING_DONTKNOW; - aDLocs[k] = MsLangId::convertLanguageToLocale( - MsLangId::convertIsoStringToLanguage( aLocaleNames[i] )); + aDLocs[k] = LanguageTag( aLocaleNames[i] ).getLocale(); // also both files have to be in the same directory and the // file names must only differ in the extension (.aff/.dic). // Thus we use the first location only and strip the extension part. diff --git a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx index 981dce45743e..22c96229c916 100644 --- a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx +++ b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include @@ -197,8 +197,7 @@ Sequence< Locale > SAL_CALL Thesaurus::getLocales() k = 0; for (aItB = aLocaleNamesSet.begin(); aItB != aLocaleNamesSet.end(); ++aItB) { - Locale aTmp( MsLangId::convertLanguageToLocale( - MsLangId::convertIsoStringToLanguage( *aItB ))); + Locale aTmp( LanguageTag( *aItB ).getLocale()); aSuppLocales[k++] = aTmp; } @@ -234,8 +233,7 @@ Sequence< Locale > SAL_CALL Thesaurus::getLocales() { aThes[k] = NULL; aTEncs[k] = RTL_TEXTENCODING_DONTKNOW; - aTLocs[k] = MsLangId::convertLanguageToLocale( - MsLangId::convertIsoStringToLanguage( aDictIt->aLocaleNames[i] )); + aTLocs[k] = LanguageTag( aDictIt->aLocaleNames[i] ).getLocale(); aCharSetInfo[k] = new CharClass( aTLocs[k] ); // also both files have to be in the same directory and the // file names must only differ in the extension (.aff/.dic). -- cgit