diff options
author | Eike Rathke <erack@redhat.com> | 2013-07-13 02:54:05 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-07-13 11:55:16 +0200 |
commit | 358d1a99484bcc02900bd200a7606a7bf3298cac (patch) | |
tree | 031f808141dbc712553b8a4a029a354a2699a622 /lingucomponent | |
parent | 5d1a8e0d47b6d6e9e3e5735d0ee52fa0b4782202 (diff) |
use static LanguageTag::convertTo...() for standalone conversions
If no LanguageTag instance is at hand use the static methods to convert
between BCP 47 string, Locale and MS-LangID instead of creating
temporary instances.
Change-Id: I9597f768078eb81c840e84a5db5617f26bb7dc09
Diffstat (limited to 'lingucomponent')
4 files changed, 6 insertions, 6 deletions
diff --git a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx index 5a9526f86df4..df80e39586f0 100644 --- a/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx +++ b/lingucomponent/source/hyphenator/altlinuxhyph/hyphen/hyphenimp.cxx @@ -165,7 +165,7 @@ Sequence< Locale > SAL_CALL Hyphenator::getLocales() k = 0; for (aItB = aLocaleNamesSet.begin(); aItB != aLocaleNamesSet.end(); ++aItB) { - Locale aTmp( LanguageTag( *aItB ).getLocale()); + Locale aTmp( LanguageTag::convertToLocale( *aItB )); aSuppLocales[k++] = aTmp; } diff --git a/lingucomponent/source/lingutil/lingutil.cxx b/lingucomponent/source/lingutil/lingutil.cxx index bd107fae82a5..f8ae521c2919 100644 --- a/lingucomponent/source/lingutil/lingutil.cxx +++ b/lingucomponent/source/lingutil/lingutil.cxx @@ -198,7 +198,7 @@ void MergeNewStyleDicsAndOldStyleDics( sal_Int32 nLocaleNames = aLocaleNames.getLength(); for (sal_Int32 k = 0; k < nLocaleNames; ++k) { - LanguageType nLang = LanguageTag( aLocaleNames[k] ).getLanguageType(); + LanguageType nLang = LanguageTag::convertToLanguageType( aLocaleNames[k] ); aNewStyleLanguages.insert( nLang ); } } @@ -214,7 +214,7 @@ void MergeNewStyleDicsAndOldStyleDics( DBG_ASSERT( nOldStyleDics, "old style dictionary with more then one language found!"); if (nOldStyleDics > 0) { - LanguageType nLang = LanguageTag( aIt2->aLocaleNames[0] ).getLanguageType(); + LanguageType nLang = LanguageTag::convertToLanguageType( aIt2->aLocaleNames[0] ); if (nLang == LANGUAGE_DONTKNOW || linguistic::LinguIsUnspecified( nLang)) { diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx index 2e4e7e6305b9..1acdf0dbc6a5 100644 --- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx +++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx @@ -165,7 +165,7 @@ Sequence< Locale > SAL_CALL SpellChecker::getLocales() k = 0; for (aItB = aLocaleNamesSet.begin(); aItB != aLocaleNamesSet.end(); ++aItB) { - Locale aTmp( LanguageTag( *aItB ).getLocale()); + Locale aTmp( LanguageTag::convertToLocale( *aItB )); aSuppLocales[k++] = aTmp; } @@ -199,7 +199,7 @@ Sequence< Locale > SAL_CALL SpellChecker::getLocales() { aDicts[k] = NULL; aDEncs[k] = RTL_TEXTENCODING_DONTKNOW; - aDLocs[k] = LanguageTag( aLocaleNames[i] ).getLocale(); + aDLocs[k] = LanguageTag::convertToLocale( aLocaleNames[i] ); // 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 69bc07bff183..4bf271d02cd3 100644 --- a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx +++ b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx @@ -187,7 +187,7 @@ Sequence< Locale > SAL_CALL Thesaurus::getLocales() k = 0; for (aItB = aLocaleNamesSet.begin(); aItB != aLocaleNamesSet.end(); ++aItB) { - Locale aTmp( LanguageTag( *aItB ).getLocale()); + Locale aTmp( LanguageTag::convertToLocale( *aItB )); aSuppLocales[k++] = aTmp; } |