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 /sc/source/ui | |
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 'sc/source/ui')
-rw-r--r-- | sc/source/ui/app/scmod2.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/dbgui/tpsort.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh2.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/impex.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/unoobj/convuno.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/unoobj/defltuno.cxx | 2 |
6 files changed, 10 insertions, 10 deletions
diff --git a/sc/source/ui/app/scmod2.cxx b/sc/source/ui/app/scmod2.cxx index 0a02cc6adeba..be7eccd80b23 100644 --- a/sc/source/ui/app/scmod2.cxx +++ b/sc/source/ui/app/scmod2.cxx @@ -74,7 +74,7 @@ sal_Bool ScModule::HasThesaurusLanguage( sal_uInt16 nLang ) { uno::Reference< linguistic2::XThesaurus > xThes(LinguMgr::GetThesaurus()); if ( xThes.is() ) - bHasLang = xThes->hasLocale( LanguageTag( nLang ).getLocale() ); + bHasLang = xThes->hasLocale( LanguageTag::convertToLocale( nLang ) ); } catch( uno::Exception& ) { diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx index 1479313136a5..8ab5a7429877 100644 --- a/sc/source/ui/dbgui/tpsort.cxx +++ b/sc/source/ui/dbgui/tpsort.cxx @@ -695,7 +695,7 @@ void ScTabPageSortOptions::Reset( const SfxItemSet& /* rArgSet */ ) m_pBtnHeader->SetText( aStrRowLabel ); } - LanguageType eLang = LanguageTag( aSortData.aCollatorLocale ).getLanguageType( false); + LanguageType eLang = LanguageTag::convertToLanguageType( aSortData.aCollatorLocale, false); if ( eLang == LANGUAGE_DONTKNOW ) eLang = LANGUAGE_SYSTEM; m_pLbLanguage->SelectLanguage( eLang ); @@ -762,7 +762,7 @@ sal_Bool ScTabPageSortOptions::FillItemSet( SfxItemSet& rArgSet ) // get locale LanguageType eLang = m_pLbLanguage->GetSelectLanguage(); - aNewSortData.aCollatorLocale = LanguageTag( eLang ).getLocale( false ); + aNewSortData.aCollatorLocale = LanguageTag::convertToLocale( eLang, false); // get algorithm OUString sAlg; @@ -989,7 +989,7 @@ IMPL_LINK_NOARG(ScTabPageSortOptions, FillAlgorHdl) } else { - lang::Locale aLocale( LanguageTag( eLang ).getLocale()); + lang::Locale aLocale( LanguageTag::convertToLocale( eLang )); uno::Sequence<OUString> aAlgos = pColWrap->listCollatorAlgorithms( aLocale ); long nCount = aAlgos.getLength(); diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx index f206a9d6dd0c..79f1c1057b40 100644 --- a/sc/source/ui/docshell/docsh2.cxx +++ b/sc/source/ui/docshell/docsh2.cxx @@ -130,7 +130,7 @@ void ScDocShell::InitItems() { i18n::ForbiddenCharacters aForbidden; aAsian.GetStartEndChars( pLocales[i], aForbidden.beginLine, aForbidden.endLine ); - LanguageType eLang = LanguageTag(pLocales[i]).getLanguageType(); + LanguageType eLang = LanguageTag::convertToLanguageType(pLocales[i]); xForbiddenTable->SetForbiddenCharacters( eLang, aForbidden ); } diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index 8629a03871ff..a2312058b573 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -1293,7 +1293,7 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm ) aTransliteration.loadModuleIfNeeded( eDocLang ); CalendarWrapper aCalendar( comphelper::getProcessComponentContext() ); aCalendar.loadDefaultCalendar( - LanguageTag( eDocLang ).getLocale() ); + LanguageTag::convertToLocale( eDocLang ) ); boost::scoped_ptr< ::utl::TransliterationWrapper > pEnglishTransliteration; boost::scoped_ptr< CalendarWrapper > pEnglishCalendar; if ( eDocLang != LANGUAGE_ENGLISH_US ) @@ -1303,7 +1303,7 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm ) aTransliteration.loadModuleIfNeeded( LANGUAGE_ENGLISH_US ); pEnglishCalendar.reset(new CalendarWrapper ( comphelper::getProcessComponentContext() )); pEnglishCalendar->loadDefaultCalendar( - LanguageTag( LANGUAGE_ENGLISH_US ).getLocale() ); + LanguageTag::convertToLocale( LANGUAGE_ENGLISH_US ) ); } OUString aLine; diff --git a/sc/source/ui/unoobj/convuno.cxx b/sc/source/ui/unoobj/convuno.cxx index 4a30dbdeda45..013ed0646acf 100644 --- a/sc/source/ui/unoobj/convuno.cxx +++ b/sc/source/ui/unoobj/convuno.cxx @@ -34,7 +34,7 @@ LanguageType ScUnoConversion::GetLanguage( const lang::Locale& rLocale ) if ( rLocale.Language.isEmpty() ) return LANGUAGE_SYSTEM; - LanguageType eRet = LanguageTag( rLocale ).getLanguageType( false); + LanguageType eRet = LanguageTag::convertToLanguageType( rLocale, false); if ( eRet == LANGUAGE_NONE ) eRet = LANGUAGE_SYSTEM; //! or throw an exception? @@ -43,7 +43,7 @@ LanguageType ScUnoConversion::GetLanguage( const lang::Locale& rLocale ) void ScUnoConversion::FillLocale( lang::Locale& rLocale, LanguageType eLang ) { - rLocale = LanguageTag( eLang ).getLocale(); + rLocale = LanguageTag::convertToLocale( eLang ); } diff --git a/sc/source/ui/unoobj/defltuno.cxx b/sc/source/ui/unoobj/defltuno.cxx index 992accaf0bfd..ab2306d95c71 100644 --- a/sc/source/ui/unoobj/defltuno.cxx +++ b/sc/source/ui/unoobj/defltuno.cxx @@ -183,7 +183,7 @@ void SAL_CALL ScDocDefaultsObj::setPropertyValue( { LanguageType eNew; if (!aLocale.Language.isEmpty() || !aLocale.Country.isEmpty()) - eNew = LanguageTag( aLocale ).getLanguageType( false); + eNew = LanguageTag::convertToLanguageType( aLocale, false); else eNew = LANGUAGE_NONE; |