From 358d1a99484bcc02900bd200a7606a7bf3298cac Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Sat, 13 Jul 2013 02:54:05 +0200 Subject: 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 --- cui/source/dialogs/SpellDialog.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cui/source/dialogs/SpellDialog.cxx') diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index f4238c789011..76bd8c29ae82 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -304,7 +304,7 @@ void SpellDialog::UpdateBoxes_Impl() bool bIsGrammarError = false; if( pSpellErrorDescription ) { - nAltLanguage = LanguageTag( pSpellErrorDescription->aLocale ).getLanguageType(); + nAltLanguage = LanguageTag::convertToLanguageType( pSpellErrorDescription->aLocale ); aNewWords = pSpellErrorDescription->aSuggestions; bIsGrammarError = pSpellErrorDescription->bIsGrammarError; m_pExplainLink->SetURL( pSpellErrorDescription->sExplanationURL ); @@ -1125,7 +1125,7 @@ bool SpellDialog::GetNextSentence_Impl(bool bUseSavedSentence, bool bRecheck) uno::Reference< lang::XServiceInfo > xInfo( aStart->xGrammarChecker, uno::UNO_QUERY ); SpellErrorDescription aDesc( true, aStart->sText, - LanguageTag( aStart->eLanguage ).getLocale(), + LanguageTag::convertToLocale( aStart->eLanguage ), aStart->aGrammarError.aSuggestions, aStart->xGrammarChecker, xInfo->getImplementationName(), @@ -1599,7 +1599,7 @@ bool SentenceEditWindow_Impl::MarkNextError( bool bIgnoreCurrentError ) String sReplacement(getDotReplacementString(GetErrorText(), xEntry->getReplacementText())); - ChangeMarkedWord(sReplacement, LanguageTag( pSpellErrorDescription->aLocale ).getLanguageType()); + ChangeMarkedWord(sReplacement, LanguageTag::convertToLanguageType( pSpellErrorDescription->aLocale )); aCursor.GetIndex() = aCursor.GetIndex() + (sal_uInt16)(xEntry->getReplacementText().getLength()); } @@ -1738,7 +1738,7 @@ void SentenceEditWindow_Impl::RestoreCurrentError() { const SpellErrorDescription& rDesc = pAttrib->GetErrorDescription(); if( !rDesc.sErrorText.equals( GetErrorText() ) ) - ChangeMarkedWord(rDesc.sErrorText, LanguageTag( rDesc.aLocale ).getLanguageType()); + ChangeMarkedWord(rDesc.sErrorText, LanguageTag::convertToLanguageType( rDesc.aLocale )); } } -- cgit