diff options
author | Eike Rathke <erack@redhat.com> | 2012-11-24 18:54:09 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2012-11-24 18:56:43 +0100 |
commit | 41956321ceefb5836feb2c119b66de7bb557740f (patch) | |
tree | e756d740615881ceeea816e7ef15096f91d7cc1e /cui/source/dialogs | |
parent | 6395c843710b59e391f10f3532442ae11fe64357 (diff) |
get rid of Svx...Locale...() double conversion nonsense
Change-Id: I21d14ff6087d1adb0ce769f2e8f8060a005250cc
Diffstat (limited to 'cui/source/dialogs')
-rw-r--r-- | cui/source/dialogs/SpellDialog.cxx | 12 | ||||
-rw-r--r-- | cui/source/dialogs/hangulhanjadlg.cxx | 4 | ||||
-rw-r--r-- | cui/source/dialogs/hyphen.cxx | 6 | ||||
-rw-r--r-- | cui/source/dialogs/thesdlg.cxx | 6 |
4 files changed, 14 insertions, 14 deletions
diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index b5ba38030d2e..b110231999bb 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -341,7 +341,7 @@ void SpellDialog::UpdateBoxes_Impl() bool bIsGrammarError = false; if( pSpellErrorDescription ) { - nAltLanguage = SvxLocaleToLanguage( pSpellErrorDescription->aLocale ); + nAltLanguage = LanguageTag( pSpellErrorDescription->aLocale ).getLanguageType(); aNewWords = pSpellErrorDescription->aSuggestions; bIsGrammarError = pSpellErrorDescription->bIsGrammarError; aExplainLink.SetURL( pSpellErrorDescription->sExplanationURL ); @@ -985,7 +985,7 @@ int SpellDialog::InitUserDicts() continue; uno::Reference< frame::XStorable > xStor( xDicTmp, uno::UNO_QUERY ); - LanguageType nActLanguage = SvxLocaleToLanguage( xDicTmp->getLocale() ); + LanguageType nActLanguage = LanguageTag( xDicTmp->getLocale() ).getLanguageType(); if( xDicTmp->isActive() && xDicTmp->getDictionaryType() != linguistic2::DictionaryType_NEGATIVE && (nLang == nActLanguage || LANGUAGE_NONE == nActLanguage ) @@ -1266,7 +1266,7 @@ bool SpellDialog::GetNextSentence_Impl(bool bUseSavedSentence, bool bRecheck) uno::Reference< lang::XServiceInfo > xInfo( aStart->xGrammarChecker, uno::UNO_QUERY ); SpellErrorDescription aDesc( true, aStart->sText, - SvxCreateLocale( aStart->eLanguage ), + LanguageTag( aStart->eLanguage ).getLocale(), aStart->aGrammarError.aSuggestions, aStart->xGrammarChecker, xInfo->getImplementationName(), @@ -1732,7 +1732,7 @@ bool SentenceEditWindow_Impl::MarkNextError( bool bIgnoreCurrentError ) String sReplacement(getDotReplacementString(GetErrorText(), xEntry->getReplacementText())); - ChangeMarkedWord(sReplacement, SvxLocaleToLanguage( pSpellErrorDescription->aLocale )); + ChangeMarkedWord(sReplacement, LanguageTag( pSpellErrorDescription->aLocale ).getLanguageType()); aCursor.GetIndex() = aCursor.GetIndex() + (sal_uInt16)(xEntry->getReplacementText().getLength()); } @@ -1754,7 +1754,7 @@ bool SentenceEditWindow_Impl::MarkNextError( bool bIgnoreCurrentError ) const SpellErrorAttrib* pOldAttrib = static_cast<const SpellErrorAttrib*>( pTextEngine->FindAttrib( TextPaM(0, nOldErrorStart), TEXTATTR_SPELL_ERROR )); pAction->SetErrorLanguageSelected(pOldAttrib && pOldAttrib->GetErrorDescription().aSuggestions.getLength() && - SvxLocaleToLanguage( pOldAttrib->GetErrorDescription().aLocale) == + LanguageTag( pOldAttrib->GetErrorDescription().aLocale).getLanguageType() == GetSpellDialog()->aLanguageLB.GetSelectLanguage()); AddUndoAction(pAction); } @@ -1871,7 +1871,7 @@ void SentenceEditWindow_Impl::RestoreCurrentError() { const SpellErrorDescription& rDesc = pAttrib->GetErrorDescription(); if( !rDesc.sErrorText.equals( GetErrorText() ) ) - ChangeMarkedWord(rDesc.sErrorText, SvxLocaleToLanguage( rDesc.aLocale )); + ChangeMarkedWord(rDesc.sErrorText, LanguageTag( rDesc.aLocale ).getLanguageType()); } } diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx index 688a8203cec6..6e8337723efa 100644 --- a/cui/source/dialogs/hangulhanjadlg.cxx +++ b/cui/source/dialogs/hangulhanjadlg.cxx @@ -962,7 +962,7 @@ namespace svx Reference< XConversionDictionary > xDic; if( ( aAny >>= xDic ) && xDic.is() ) { - if( LANGUAGE_KOREAN == SvxLocaleToLanguage( xDic->getLocale() ) ) + if( LANGUAGE_KOREAN == LanguageTag( xDic->getLocale() ).getLanguageType() ) { m_aDictList.push_back( xDic ); AddDict( xDic->getName(), xDic->isActive() ); @@ -1049,7 +1049,7 @@ namespace svx try { Reference< XConversionDictionary > xDic = - m_xConversionDictionaryList->addNewDictionary( aName, SvxCreateLocale( LANGUAGE_KOREAN ), ConversionDictionaryType::HANGUL_HANJA ); + m_xConversionDictionaryList->addNewDictionary( aName, LanguageTag( LANGUAGE_KOREAN ).getLocale(), ConversionDictionaryType::HANGUL_HANJA ); if( xDic.is() ) { diff --git a/cui/source/dialogs/hyphen.cxx b/cui/source/dialogs/hyphen.cxx index cd0f7756e182..de16810aeff1 100644 --- a/cui/source/dialogs/hyphen.cxx +++ b/cui/source/dialogs/hyphen.cxx @@ -207,7 +207,7 @@ void SvxHyphenWordDialog::InitControls_Impl() xPossHyph = NULL; if (xHyphenator.is()) { - lang::Locale aLocale( SvxCreateLocale(nActLanguage) ); + lang::Locale aLocale( LanguageTag(nActLanguage).getLocale() ); xPossHyph = xHyphenator->createPossibleHyphens( aActWord, aLocale, uno::Sequence< beans::PropertyValue >() ); if (xPossHyph.is()) @@ -265,7 +265,7 @@ void SvxHyphenWordDialog::ContinueHyph_Impl( sal_uInt16 nInsPos ) if(xHyphWord.is()) { aActWord = String( xHyphWord->getWord() ); - nActLanguage = SvxLocaleToLanguage( xHyphWord->getLocale() ); + nActLanguage = LanguageTag( xHyphWord->getLocale() ).getLanguageType(); nMaxHyphenationPos = xHyphWord->getHyphenationPos(); InitControls_Impl(); SetWindowTitle( nActLanguage ); @@ -489,7 +489,7 @@ SvxHyphenWordDialog::SvxHyphenWordDialog( if (xHyphWord.is()) { DBG_ASSERT( aActWord == String( xHyphWord->getWord() ), "word mismatch" ); - DBG_ASSERT( nActLanguage == SvxLocaleToLanguage( xHyphWord->getLocale() ), "language mismatch" ); + DBG_ASSERT( nActLanguage == LanguageTag( xHyphWord->getLocale() ).getLanguageType(), "language mismatch" ); nMaxHyphenationPos = xHyphWord->getHyphenationPos(); } diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx index e428bedabca0..b222b19efa1b 100644 --- a/cui/source/dialogs/thesdlg.cxx +++ b/cui/source/dialogs/thesdlg.cxx @@ -291,7 +291,7 @@ uno::Sequence< uno::Reference< linguistic2::XMeaning > > SvxThesaurusDialog::que bool SvxThesaurusDialog::UpdateAlternativesBox_Impl() { - lang::Locale aLocale( SvxCreateLocale( nLookUpLanguage ) ); + lang::Locale aLocale( LanguageTag( nLookUpLanguage ).getLocale() ); uno::Sequence< uno::Reference< linguistic2::XMeaning > > aMeanings = queryMeanings_Impl( aLookUpText, aLocale, uno::Sequence< beans::PropertyValue >() ); const sal_Int32 nMeanings = aMeanings.getLength(); @@ -350,7 +350,7 @@ IMPL_LINK( SvxThesaurusDialog, LanguageHdl_Impl, MenuButton*, pBtn ) String aLangText( pMenu->GetItemText( nItem ) ); LanguageType nLang = SvtLanguageTable().GetType( aLangText ); DBG_ASSERT( nLang != LANGUAGE_NONE && nLang != LANGUAGE_DONTKNOW, "failed to get language" ); - if (xThesaurus->hasLocale( SvxCreateLocale( nLang ) )) + if (xThesaurus->hasLocale( LanguageTag( nLang ).getLocale() )) nLookUpLanguage = nLang; SetWindowTitle( nLang ); LookUp_Impl(); @@ -505,7 +505,7 @@ SvxThesaurusDialog::SvxThesaurusDialog( std::vector< OUString > aLangVec; for (sal_Int32 i = 0; i < nLocales; ++i) { - const LanguageType nLang = SvxLocaleToLanguage( pLocales[i] ); + const LanguageType nLang = LanguageTag( pLocales[i] ).getLanguageType(); DBG_ASSERT( nLang != LANGUAGE_NONE && nLang != LANGUAGE_DONTKNOW, "failed to get language" ); aLangVec.push_back( aLangTab.GetString( nLang ) ); } |