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 /linguistic/source/spelldsp.cxx | |
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 'linguistic/source/spelldsp.cxx')
-rw-r--r-- | linguistic/source/spelldsp.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/linguistic/source/spelldsp.cxx b/linguistic/source/spelldsp.cxx index a1d697edff43..9a1ebca67220 100644 --- a/linguistic/source/spelldsp.cxx +++ b/linguistic/source/spelldsp.cxx @@ -167,7 +167,7 @@ sal_Bool SvcListHasLanguage( if (pRef[k].is()) { if (aTmpLocale.Language.isEmpty()) - aTmpLocale = LanguageTag( nLanguage ).getLocale(); + aTmpLocale = LanguageTag::convertToLocale( nLanguage ); bHasLanguage = pRef[k]->hasLocale( aTmpLocale ); } } @@ -209,7 +209,7 @@ Sequence< Locale > SAL_CALL SpellCheckerDispatcher::getLocales() SpellSvcByLangMap_t::const_iterator aIt; for (aIt = aSvcMap.begin(); aIt != aSvcMap.end(); ++aIt) { - *pLocales++ = LanguageTag( aIt->first ).getLocale(); + *pLocales++ = LanguageTag::convertToLocale( aIt->first ); } return aLocales; } @@ -299,7 +299,7 @@ sal_Bool SpellCheckerDispatcher::isValid_Impl( if (pEntry) { OUString aChkWord( rWord ); - Locale aLocale( LanguageTag( nLanguage ).getLocale() ); + Locale aLocale( LanguageTag::convertToLocale( nLanguage ) ); // replace typographical apostroph by ascii apostroph String aSingleQuote( GetLocaleDataWrapper( nLanguage ).getQuotationMarkEnd() ); @@ -466,7 +466,7 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( if (pEntry) { OUString aChkWord( rWord ); - Locale aLocale( LanguageTag( nLanguage ).getLocale() ); + Locale aLocale( LanguageTag::convertToLocale( nLanguage ) ); // replace typographical apostroph by ascii apostroph String aSingleQuote( GetLocaleDataWrapper( nLanguage ).getQuotationMarkEnd() ); @@ -728,7 +728,7 @@ sal_Bool SAL_CALL SpellCheckerDispatcher::hasLanguage( throw (uno::RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); - return hasLocale( LanguageTag( nLanguage).getLocale() ); + return hasLocale( LanguageTag::convertToLocale( nLanguage) ); } @@ -739,7 +739,7 @@ sal_Bool SAL_CALL SpellCheckerDispatcher::isValid( throw (lang::IllegalArgumentException, uno::RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); - return isValid( rWord, LanguageTag( nLanguage ).getLocale(), rProperties); + return isValid( rWord, LanguageTag::convertToLocale( nLanguage ), rProperties); } @@ -750,7 +750,7 @@ uno::Reference< linguistic2::XSpellAlternatives > SAL_CALL SpellCheckerDispatche throw (lang::IllegalArgumentException, uno::RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); - return spell( rWord, LanguageTag( nLanguage).getLocale(), rProperties); + return spell( rWord, LanguageTag::convertToLocale( nLanguage), rProperties); } |