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 | |
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
108 files changed, 211 insertions, 211 deletions
diff --git a/basctl/source/basicide/basicbox.cxx b/basctl/source/basicide/basicbox.cxx index 375b6ac3fc66..db86fdfaffc7 100644 --- a/basctl/source/basicide/basicbox.cxx +++ b/basctl/source/basicide/basicbox.cxx @@ -416,7 +416,7 @@ void LanguageBox::FillBox() { bool bIsDefault = localesAreEqual( aDefaultLocale, pLocale[i] ); bool bIsCurrent = localesAreEqual( aCurrentLocale, pLocale[i] ); - LanguageType eLangType = LanguageTag( pLocale[i] ).getLanguageType(); + LanguageType eLangType = LanguageTag::convertToLanguageType( pLocale[i] ); OUString sLanguage = aLangTable.GetString( eLangType ); if ( bIsDefault ) { diff --git a/basctl/source/dlged/managelang.cxx b/basctl/source/dlged/managelang.cxx index 1efc75e482ee..dc5326e45a57 100644 --- a/basctl/source/dlged/managelang.cxx +++ b/basctl/source/dlged/managelang.cxx @@ -170,7 +170,7 @@ void ManageLanguageDialog::FillLanguageBox() for ( i = 0; i < nCount; ++i ) { bool bIsDefault = localesAreEqual( aDefaultLocale, pLocale[i] ); - LanguageType eLangType = LanguageTag( pLocale[i] ).getLanguageType(); + LanguageType eLangType = LanguageTag::convertToLanguageType( pLocale[i] ); OUStringBuffer sLanguageBuf(aLangTable.GetString( eLangType )); if ( bIsDefault ) { @@ -325,7 +325,7 @@ void SetDefaultLanguageDialog::FillLanguageBox() const Locale* pLocale = aLocaleSeq.getConstArray(); sal_Int32 i, nCount = aLocaleSeq.getLength(); for ( i = 0; i < nCount; ++i ) - m_pLanguageLB->RemoveLanguage( LanguageTag( pLocale[i] ).getLanguageType() ); + m_pLanguageLB->RemoveLanguage( LanguageTag::convertToLanguageType( pLocale[i] ) ); // fill checklistbox if not in default mode if ( m_pLocalizationMgr->isLibraryLocalized() ) @@ -390,7 +390,7 @@ Sequence< Locale > SetDefaultLanguageDialog::GetLocales() const if ( m_pCheckLangLB->IsChecked(i) ) { LanguageType eType = LanguageType( (sal_uLong)m_pCheckLangLB->GetEntryData(i) ); - aLocaleSeq[j++] = LanguageTag( eType ).getLocale(); + aLocaleSeq[j++] = LanguageTag::convertToLocale( eType ); } } DBG_ASSERT( nSize == j, "SetDefaultLanguageDialog::GetLocales(): invalid indexes" ); diff --git a/canvas/source/cairo/cairo_canvasfont.cxx b/canvas/source/cairo/cairo_canvasfont.cxx index e4e8d245a2b9..4c627f7276bf 100644 --- a/canvas/source/cairo/cairo_canvasfont.cxx +++ b/canvas/source/cairo/cairo_canvasfont.cxx @@ -57,7 +57,7 @@ namespace cairocanvas rFontRequest.FontDescription.FontDescription.Proportion == rendering::PanoseProportion::MONO_SPACED ? PITCH_FIXED : PITCH_VARIABLE); - maFont->SetLanguage( LanguageTag( rFontRequest.Locale).getLanguageType( false)); + maFont->SetLanguage( LanguageTag::convertToLanguageType( rFontRequest.Locale, false)); // adjust to stretched/shrinked font if( !::rtl::math::approxEqual( rFontMatrix.m00, rFontMatrix.m11) ) diff --git a/canvas/source/directx/dx_textlayout_drawhelper.cxx b/canvas/source/directx/dx_textlayout_drawhelper.cxx index 791603022ed6..d1f76e6233ea 100644 --- a/canvas/source/directx/dx_textlayout_drawhelper.cxx +++ b/canvas/source/directx/dx_textlayout_drawhelper.cxx @@ -125,7 +125,7 @@ namespace dxcanvas rFontRequest.FontDescription.FontDescription.Proportion == rendering::PanoseProportion::MONO_SPACED ? PITCH_FIXED : PITCH_VARIABLE); - aFont.SetLanguage(LanguageTag(rFontRequest.Locale).getLanguageType()); + aFont.SetLanguage(LanguageTag::convertToLanguageType(rFontRequest.Locale)); // setup font color aFont.SetColor( aColor ); diff --git a/canvas/source/vcl/canvasfont.cxx b/canvas/source/vcl/canvasfont.cxx index 549cf3e139cf..783ace10ff64 100644 --- a/canvas/source/vcl/canvasfont.cxx +++ b/canvas/source/vcl/canvasfont.cxx @@ -59,7 +59,7 @@ namespace vclcanvas rFontRequest.FontDescription.FontDescription.Proportion == rendering::PanoseProportion::MONO_SPACED ? PITCH_FIXED : PITCH_VARIABLE); - maFont->SetLanguage( LanguageTag( rFontRequest.Locale).getLanguageType( false)); + maFont->SetLanguage( LanguageTag::convertToLanguageType( rFontRequest.Locale, false)); // adjust to stretched/shrinked font if( !::rtl::math::approxEqual( rFontMatrix.m00, rFontMatrix.m11) ) diff --git a/chart2/source/tools/CharacterProperties.cxx b/chart2/source/tools/CharacterProperties.cxx index 40c79a3cb55d..ff8b8c9a167c 100644 --- a/chart2/source/tools/CharacterProperties.cxx +++ b/chart2/source/tools/CharacterProperties.cxx @@ -409,11 +409,11 @@ void CharacterProperties::AddDefaultsToMap( using namespace ::com::sun::star::i18n::ScriptType; LanguageType nLang; - nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag(aDefaultLocale).getLanguageType( false), LATIN); + nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType( aDefaultLocale, false), LATIN); Font aFont = OutputDevice::GetDefaultFont( DEFAULTFONT_LATIN_SPREADSHEET, nLang, DEFAULTFONT_FLAGS_ONLYONE, 0 ); - nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag( aDefaultLocale_CJK).getLanguageType( false), ASIAN); + nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType( aDefaultLocale_CJK, false), ASIAN); Font aFontCJK = OutputDevice::GetDefaultFont( DEFAULTFONT_CJK_SPREADSHEET, nLang, DEFAULTFONT_FLAGS_ONLYONE, 0 ); - nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag( aDefaultLocale_CTL).getLanguageType( false), COMPLEX); + nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType( aDefaultLocale_CTL, false), COMPLEX); Font aFontCTL = OutputDevice::GetDefaultFont( DEFAULTFONT_CTL_SPREADSHEET, nLang, DEFAULTFONT_FLAGS_ONLYONE, 0 ); ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_FONT_NAME, OUString( aFont.GetName() ) ); diff --git a/configmgr/source/configurationprovider.cxx b/configmgr/source/configurationprovider.cxx index d5edfabdbaec..9244f989e404 100644 --- a/configmgr/source/configurationprovider.cxx +++ b/configmgr/source/configurationprovider.cxx @@ -330,14 +330,14 @@ void Service::setLocale(css::lang::Locale const & eLocale) throw (css::uno::RuntimeException) { osl::MutexGuard guard(*lock_); - locale_ = LanguageTag( eLocale).getBcp47(); + locale_ = LanguageTag::convertToBcp47( eLocale); } css::lang::Locale Service::getLocale() throw (css::uno::RuntimeException) { osl::MutexGuard guard(*lock_); css::lang::Locale loc; if (! locale_.isEmpty()) { - loc = LanguageTag( locale_).getLocale( false); + loc = LanguageTag::convertToLocale( locale_, false); } return loc; } diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index 8f1dd8dfd671..17c68c4e5072 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -785,7 +785,7 @@ namespace cppcanvas : rendering::PanoseProportion::ANYTHING; LanguageType aLang = rFont.GetLanguage(); - aFontRequest.Locale = LanguageTag( aLang).getLocale( false); + aFontRequest.Locale = LanguageTag::convertToLocale( aLang, false); // setup state-local text transformation, // if the font be rotated 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 )); } } diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx index ffa32ff7ace6..8ef83409bad5 100644 --- a/cui/source/dialogs/hangulhanjadlg.cxx +++ b/cui/source/dialogs/hangulhanjadlg.cxx @@ -1037,7 +1037,7 @@ namespace svx try { Reference< XConversionDictionary > xDic = - m_xConversionDictionaryList->addNewDictionary( aName, LanguageTag( LANGUAGE_KOREAN ).getLocale(), ConversionDictionaryType::HANGUL_HANJA ); + m_xConversionDictionaryList->addNewDictionary( aName, LanguageTag::convertToLocale( LANGUAGE_KOREAN ), ConversionDictionaryType::HANGUL_HANJA ); if( xDic.is() ) { diff --git a/cui/source/dialogs/hyphen.cxx b/cui/source/dialogs/hyphen.cxx index 7e4e72474045..734a9e97405a 100644 --- a/cui/source/dialogs/hyphen.cxx +++ b/cui/source/dialogs/hyphen.cxx @@ -209,7 +209,7 @@ void SvxHyphenWordDialog::InitControls_Impl() xPossHyph = NULL; if (xHyphenator.is()) { - lang::Locale aLocale( LanguageTag(nActLanguage).getLocale() ); + lang::Locale aLocale( LanguageTag::convertToLocale(nActLanguage) ); xPossHyph = xHyphenator->createPossibleHyphens( aActWord, aLocale, uno::Sequence< beans::PropertyValue >() ); if (xPossHyph.is()) diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx index 713bbae4d673..7d642c813376 100644 --- a/cui/source/dialogs/thesdlg.cxx +++ b/cui/source/dialogs/thesdlg.cxx @@ -289,7 +289,7 @@ uno::Sequence< uno::Reference< linguistic2::XMeaning > > SvxThesaurusDialog::que bool SvxThesaurusDialog::UpdateAlternativesBox_Impl() { - lang::Locale aLocale( LanguageTag( nLookUpLanguage ).getLocale() ); + lang::Locale aLocale( LanguageTag::convertToLocale( nLookUpLanguage ) ); uno::Sequence< uno::Reference< linguistic2::XMeaning > > aMeanings = queryMeanings_Impl( aLookUpText, aLocale, uno::Sequence< beans::PropertyValue >() ); const sal_Int32 nMeanings = aMeanings.getLength(); @@ -344,7 +344,7 @@ IMPL_LINK( SvxThesaurusDialog, LanguageHdl_Impl, ListBox*, pLB ) String aLangText( pLB->GetSelectEntry() ); LanguageType nLang = SvtLanguageTable().GetType( aLangText ); DBG_ASSERT( nLang != LANGUAGE_NONE && nLang != LANGUAGE_DONTKNOW, "failed to get language" ); - if (xThesaurus->hasLocale( LanguageTag( nLang ).getLocale() )) + if (xThesaurus->hasLocale( LanguageTag::convertToLocale( nLang ) )) nLookUpLanguage = nLang; SetWindowTitle( nLang ); LookUp_Impl(); @@ -496,7 +496,7 @@ SvxThesaurusDialog::SvxThesaurusDialog( std::vector< OUString > aLangVec; for (sal_Int32 i = 0; i < nLocales; ++i) { - const LanguageType nLang = LanguageTag( pLocales[i] ).getLanguageType(); + const LanguageType nLang = LanguageTag::convertToLanguageType( pLocales[i] ); DBG_ASSERT( nLang != LANGUAGE_NONE && nLang != LANGUAGE_DONTKNOW, "failed to get language" ); aLangVec.push_back( aLangTab.GetString( nLang ) ); } diff --git a/cui/source/options/optasian.cxx b/cui/source/options/optasian.cxx index d035daf373f2..a74b30a28bf0 100644 --- a/cui/source/options/optasian.cxx +++ b/cui/source/options/optasian.cxx @@ -201,7 +201,7 @@ sal_Bool SvxAsianLayoutPage::FillItemSet( SfxItemSet& ) for( itElem = pImpl->aChangedLanguagesMap.begin(); itElem != pImpl->aChangedLanguagesMap.end(); ++itElem ) { - Locale aLocale( LanguageTag( itElem->first ).getLocale()); + Locale aLocale( LanguageTag::convertToLocale( itElem->first )); if(itElem->second->bRemoved) pImpl->xForbidden->removeForbiddenCharacters( aLocale ); else if(itElem->second->pCharacters) @@ -378,7 +378,7 @@ IMPL_LINK(SvxAsianLayoutPage, ChangeStandardHdl, CheckBox*, pBox) IMPL_LINK(SvxAsianLayoutPage, ModifyHdl, Edit*, pEdit) { LanguageType eSelectLanguage = aLanguageLB.GetSelectLanguage(); - Locale aLocale( LanguageTag( eSelectLanguage ).getLocale()); + Locale aLocale( LanguageTag::convertToLocale( eSelectLanguage )); OUString sStart = aStartED.GetText(); OUString sEnd = aEndED.GetText(); sal_Bool bEnable = pEdit->IsEnabled(); diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx index 8572341db884..36af1fb918f2 100644 --- a/cui/source/options/optdict.cxx +++ b/cui/source/options/optdict.cxx @@ -151,7 +151,7 @@ IMPL_LINK_NOARG(SvxNewDictionaryDialog, OKHdl_Impl) DictionaryType_NEGATIVE : DictionaryType_POSITIVE; if (xDicList.is()) { - lang::Locale aLocale( LanguageTag(nLang).getLocale() ); + lang::Locale aLocale( LanguageTag::convertToLocale(nLang) ); String aURL( linguistic::GetWritableDictionaryURL( sDict ) ); xNewDic = Reference< XDictionary > ( xDicList->createDictionary( sDict, aLocale, eType, aURL ) , UNO_QUERY ); @@ -451,7 +451,7 @@ IMPL_LINK_NOARG(SvxEditDictionaryDialog, SelectLangHdl_Impl) if ( aBox.Execute() == RET_YES ) { - xDic->setLocale( LanguageTag( nLang ).getLocale() ); + xDic->setLocale( LanguageTag::convertToLocale( nLang ) ); bool bNegativ = xDic->getDictionaryType() == DictionaryType_NEGATIVE; const String sName( diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index 29b166a73c51..1510a16d6207 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -1045,7 +1045,7 @@ OfaLanguagesTabPage::OfaLanguagesTabPage( Window* pParent, const SfxItemSet& rSe LanguageType aLang = LANGUAGE_DONTKNOW; for (sal_IntPtr i=0; i<seqInstalledLanguages.getLength(); i++) { - aLang = LanguageTag(seqInstalledLanguages[i]).getLanguageType(); + aLang = LanguageTag::convertToLanguageType(seqInstalledLanguages[i]); if (aLang != LANGUAGE_DONTKNOW) { //sal_uInt16 p = m_pUserInterfaceLB->InsertLanguage(aLang); @@ -1245,14 +1245,14 @@ sal_Bool OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet ) OUString sLang = pLangConfig->aSysLocaleOptions.GetLocaleConfigString(); LanguageType eOldLocale = (!sLang.isEmpty() ? - LanguageTag( sLang ).getLanguageType() : LANGUAGE_SYSTEM); + LanguageTag::convertToLanguageType( sLang ) : LANGUAGE_SYSTEM); LanguageType eNewLocale = m_pLocaleSettingLB->GetSelectLanguage(); if ( eOldLocale != eNewLocale ) { // an empty string denotes SYSTEM locale OUString sNewLang; if ( eNewLocale != LANGUAGE_SYSTEM ) - sNewLang = LanguageTag( eNewLocale).getBcp47(); + sNewLang = LanguageTag::convertToBcp47( eNewLocale); // locale nowadays get to AppSettings via notification // this will happen after releasing the lock on the ConfigurationBroadcaster at @@ -1303,7 +1303,7 @@ sal_Bool OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet ) if(!bCurrentDocCBChecked) { Any aValue; - Locale aLocale = LanguageTag( eSelectLang).getLocale( false ); + Locale aLocale = LanguageTag::convertToLocale( eSelectLang, false); aValue <<= aLocale; OUString aPropName( "DefaultLocale" ); pLangConfig->aLinguConfig.SetProperty( aPropName, aValue ); @@ -1323,7 +1323,7 @@ sal_Bool OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet ) if(!bCurrentDocCBChecked) { Any aValue; - Locale aLocale = LanguageTag( eSelectLang).getLocale( false ); + Locale aLocale = LanguageTag::convertToLocale( eSelectLang, false); aValue <<= aLocale; OUString aPropName( "DefaultLocale_CJK" ); pLangConfig->aLinguConfig.SetProperty( aPropName, aValue ); @@ -1343,7 +1343,7 @@ sal_Bool OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet ) if(!bCurrentDocCBChecked) { Any aValue; - Locale aLocale = LanguageTag( eSelectLang).getLocale( false ); + Locale aLocale = LanguageTag::convertToLocale( eSelectLang, false); aValue <<= aLocale; OUString aPropName( "DefaultLocale_CTL" ); pLangConfig->aLinguConfig.SetProperty( aPropName, aValue ); @@ -1407,7 +1407,7 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet& rSet ) { OUString sLang = pLangConfig->aSysLocaleOptions.GetLocaleConfigString(); if ( !sLang.isEmpty() ) - m_pLocaleSettingLB->SelectLanguage(LanguageTag(sLang).getLanguageType()); + m_pLocaleSettingLB->SelectLanguage(LanguageTag::convertToLanguageType(sLang)); else m_pLocaleSettingLB->SelectLanguage( LANGUAGE_USER_SYSTEM_CONFIG ); sal_Bool bReadonly = pLangConfig->aSysLocaleOptions.IsReadOnly(SvtSysLocaleOptions::E_LOCALE); @@ -1473,17 +1473,17 @@ void OfaLanguagesTabPage::Reset( const SfxItemSet& rSet ) Locale aLocale; aWestLang >>= aLocale; - eCurLang = LanguageTag( aLocale ).getLanguageType( false); + eCurLang = LanguageTag::convertToLanguageType( aLocale, false); aCJKLang = pLangConfig->aLinguConfig.GetProperty("DefaultLocale_CJK"); aLocale = Locale(); aCJKLang >>= aLocale; - eCurLangCJK = LanguageTag( aLocale ).getLanguageType( false); + eCurLangCJK = LanguageTag::convertToLanguageType( aLocale, false); aCTLLang = pLangConfig->aLinguConfig.GetProperty("DefaultLocale_CTL"); aLocale = Locale(); aCTLLang >>= aLocale; - eCurLangCTL = LanguageTag( aLocale ).getLanguageType( false); + eCurLangCTL = LanguageTag::convertToLanguageType( aLocale, false); } catch (const Exception&) { diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx index 4398ce11ff68..b0d050d8e7a8 100644 --- a/cui/source/options/optlingu.cxx +++ b/cui/source/options/optlingu.cxx @@ -96,7 +96,7 @@ static Sequence< sal_Int16 > lcl_LocaleSeqToLangSeq( const Sequence< Locale > &r const Locale *pSeq = rSeq.getConstArray(); for (sal_Int32 i = 0; i < nLen; ++i) { - pRes[i] = LanguageTag( pSeq[i] ).getLanguageType(); + pRes[i] = LanguageTag::convertToLanguageType( pSeq[i] ); } return aRes; } @@ -838,7 +838,7 @@ SvxLinguData_Impl::SvxLinguData_Impl() : const Locale* pAllLocales = aAllServiceLocales.getConstArray(); for(sal_Int32 nLocale = 0; nLocale < aAllServiceLocales.getLength(); nLocale++) { - sal_Int16 nLang = LanguageTag( pAllLocales[nLocale] ).getLanguageType(); + sal_Int16 nLang = LanguageTag::convertToLanguageType( pAllLocales[nLocale] ); aCfgSvcs = xLinguSrvcMgr->getConfiguredServices(cSpell, pAllLocales[nLocale]); SetChecked( aCfgSvcs ); @@ -979,7 +979,7 @@ void SvxLinguData_Impl::Reconfigure( const OUString &rDisplayName, sal_Bool bEna nLocales = aLocales.getLength(); for (i = 0; i < nLocales; ++i) { - sal_Int16 nLang = LanguageTag( pLocale[i] ).getLanguageType(); + sal_Int16 nLang = LanguageTag::convertToLanguageType( pLocale[i] ); if (!aCfgSpellTable.count( nLang ) && bEnable) aCfgSpellTable[ nLang ] = Sequence< OUString >(); if (aCfgSpellTable.count( nLang )) @@ -995,7 +995,7 @@ void SvxLinguData_Impl::Reconfigure( const OUString &rDisplayName, sal_Bool bEna nLocales = aLocales.getLength(); for (i = 0; i < nLocales; ++i) { - sal_Int16 nLang = LanguageTag( pLocale[i] ).getLanguageType(); + sal_Int16 nLang = LanguageTag::convertToLanguageType( pLocale[i] ); if (!aCfgGrammarTable.count( nLang ) && bEnable) aCfgGrammarTable[ nLang ] = Sequence< OUString >(); if (aCfgGrammarTable.count( nLang )) @@ -1011,7 +1011,7 @@ void SvxLinguData_Impl::Reconfigure( const OUString &rDisplayName, sal_Bool bEna nLocales = aLocales.getLength(); for (i = 0; i < nLocales; ++i) { - sal_Int16 nLang = LanguageTag( pLocale[i] ).getLanguageType(); + sal_Int16 nLang = LanguageTag::convertToLanguageType( pLocale[i] ); if (!aCfgHyphTable.count( nLang ) && bEnable) aCfgHyphTable[ nLang ] = Sequence< OUString >(); if (aCfgHyphTable.count( nLang )) @@ -1027,7 +1027,7 @@ void SvxLinguData_Impl::Reconfigure( const OUString &rDisplayName, sal_Bool bEna nLocales = aLocales.getLength(); for (i = 0; i < nLocales; ++i) { - sal_Int16 nLang = LanguageTag( pLocale[i] ).getLanguageType(); + sal_Int16 nLang = LanguageTag::convertToLanguageType( pLocale[i] ); if (!aCfgThesTable.count( nLang ) && bEnable) aCfgThesTable[ nLang ] = Sequence< OUString >(); if (aCfgThesTable.count( nLang )) @@ -1203,7 +1203,7 @@ sal_Bool SvxLinguTabPage::FillItemSet( SfxItemSet& rCoreSet ) sal_Int16 nLang = aIt->first; const Sequence< OUString > aImplNames( aIt->second ); uno::Reference< XLinguServiceManager2 > xMgr( pLinguData->GetManager() ); - Locale aLocale( LanguageTag(nLang).getLocale() ); + Locale aLocale( LanguageTag::convertToLocale(nLang) ); if (xMgr.is()) xMgr->setConfiguredServices( cSpell, aLocale, aImplNames ); } @@ -1215,7 +1215,7 @@ sal_Bool SvxLinguTabPage::FillItemSet( SfxItemSet& rCoreSet ) sal_Int16 nLang = aIt->first; const Sequence< OUString > aImplNames( aIt->second ); uno::Reference< XLinguServiceManager2 > xMgr( pLinguData->GetManager() ); - Locale aLocale( LanguageTag(nLang).getLocale() ); + Locale aLocale( LanguageTag::convertToLocale(nLang) ); if (xMgr.is()) xMgr->setConfiguredServices( cGrammar, aLocale, aImplNames ); } @@ -1227,7 +1227,7 @@ sal_Bool SvxLinguTabPage::FillItemSet( SfxItemSet& rCoreSet ) sal_Int16 nLang = aIt->first; const Sequence< OUString > aImplNames( aIt->second ); uno::Reference< XLinguServiceManager2 > xMgr( pLinguData->GetManager() ); - Locale aLocale( LanguageTag(nLang).getLocale() ); + Locale aLocale( LanguageTag::convertToLocale(nLang) ); if (xMgr.is()) xMgr->setConfiguredServices( cHyph, aLocale, aImplNames ); } @@ -1239,7 +1239,7 @@ sal_Bool SvxLinguTabPage::FillItemSet( SfxItemSet& rCoreSet ) sal_Int16 nLang = aIt->first; const Sequence< OUString > aImplNames( aIt->second ); uno::Reference< XLinguServiceManager2 > xMgr( pLinguData->GetManager() ); - Locale aLocale( LanguageTag(nLang).getLocale() ); + Locale aLocale( LanguageTag::convertToLocale(nLang) ); if (xMgr.is()) xMgr->setConfiguredServices( cThes, aLocale, aImplNames ); } @@ -1631,7 +1631,7 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, PushButton *, pBtn ) sal_Int32 nLocales = pLinguData->GetAllSupportedLocales().getLength(); for (sal_Int32 k = 0; k < nLocales; ++k) { - sal_Int16 nLang = LanguageTag( pAllLocales[k] ).getLanguageType(); + sal_Int16 nLang = LanguageTag::convertToLanguageType( pAllLocales[k] ); if (pLinguData->GetSpellTable().count( nLang )) pLinguData->SetChecked( pLinguData->GetSpellTable()[ nLang ] ); if (pLinguData->GetGrammarTable().count( nLang )) @@ -1983,7 +1983,7 @@ SvxEditModulesDlg::SvxEditModulesDlg(Window* pParent, SvxLinguData_Impl& rData) aLanguageLB.Clear(); for(long i = 0; i < rLoc.getLength(); i++) { - sal_Int16 nLang = LanguageTag( pLocales[i] ).getLanguageType(); + sal_Int16 nLang = LanguageTag::convertToLanguageType( pLocales[i] ); aLanguageLB.InsertLanguage( nLang, lcl_SeqHasLang( aAvailLang, nLang ) ); } LanguageType eSysLang = MsLangId::getSystemLanguage(); @@ -2092,7 +2092,7 @@ IMPL_LINK( SvxEditModulesDlg, LangSelectHdl_Impl, ListBox *, pBox ) { LanguageType eCurLanguage = aLanguageLB.GetSelectLanguage(); static Locale aLastLocale; - Locale aCurLocale( LanguageTag( eCurLanguage).getLocale()); + Locale aCurLocale( LanguageTag::convertToLocale( eCurLanguage)); SvTreeList *pModel = aModulesCLB.GetModel(); if (pBox) @@ -2100,7 +2100,7 @@ IMPL_LINK( SvxEditModulesDlg, LangSelectHdl_Impl, ListBox *, pBox ) // save old probably changed settings // before switching to new language entries - sal_Int16 nLang = LanguageTag( aLastLocale ).getLanguageType(); + sal_Int16 nLang = LanguageTag::convertToLanguageType( aLastLocale ); sal_Int32 nStart = 0, nLocalIndex = 0; Sequence< OUString > aChange; diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index 9efb4388f9c1..11b6c7cdda04 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -1366,7 +1366,7 @@ OfaAutocorrExceptPage::OfaAutocorrExceptPage(Window* pParent, const SfxItemSet& get(m_pDelDoublePB, "deldouble"); get(m_pAutoCapsCB, "autodouble"); - ::com::sun::star::lang::Locale aLcl( LanguageTag(eLastDialogLanguage ).getLocale()); + ::com::sun::star::lang::Locale aLcl( LanguageTag::convertToLocale(eLastDialogLanguage )); pCompareClass = new CollatorWrapper( comphelper::getProcessComponentContext() ); pCompareClass->loadDefaultCollator( aLcl, 0 ); @@ -1537,7 +1537,7 @@ void OfaAutocorrExceptPage::SetLanguage(LanguageType eSet) eLastDialogLanguage = eSet; delete pCompareClass; pCompareClass = new CollatorWrapper( comphelper::getProcessComponentContext() ); - pCompareClass->loadDefaultCollator( LanguageTag( eLastDialogLanguage ).getLocale(), 0 ); + pCompareClass->loadDefaultCollator( LanguageTag::convertToLocale( eLastDialogLanguage ), 0 ); ModifyHdl(m_pAbbrevED); ModifyHdl(m_pDoubleCapsED); } @@ -2425,7 +2425,7 @@ void OfaSmartTagOptionsTabPage::FillListBox( const SmartTagMgr& rSmartTagMgr ) // fill list box: const sal_uInt32 nNumberOfRecognizers = rSmartTagMgr.NumberOfRecognizers(); - const lang::Locale aLocale( LanguageTag( eLastDialogLanguage ).getLocale() ); + const lang::Locale aLocale( LanguageTag::convertToLocale( eLastDialogLanguage ) ); for ( sal_uInt32 i = 0; i < nNumberOfRecognizers; ++i ) { @@ -2468,7 +2468,7 @@ IMPL_LINK_NOARG(OfaSmartTagOptionsTabPage, ClickHdl) uno::Reference< smarttags::XSmartTagRecognizer > xRec = pUserData->mxRec; const sal_Int32 nSmartTagIdx = pUserData->mnSmartTagIdx; - const lang::Locale aLocale( LanguageTag( eLastDialogLanguage ).getLocale() ); + const lang::Locale aLocale( LanguageTag::convertToLocale( eLastDialogLanguage ) ); if ( xRec->hasPropertyPage( nSmartTagIdx, aLocale ) ) xRec->displayPropertyPage( nSmartTagIdx, aLocale ); @@ -2507,7 +2507,7 @@ IMPL_LINK_NOARG(OfaSmartTagOptionsTabPage, SelectHdl) uno::Reference< smarttags::XSmartTagRecognizer > xRec = pUserData->mxRec; const sal_Int32 nSmartTagIdx = pUserData->mnSmartTagIdx; - const lang::Locale aLocale( LanguageTag( eLastDialogLanguage ).getLocale() ); + const lang::Locale aLocale( LanguageTag::convertToLocale( eLastDialogLanguage ) ); if ( xRec->hasPropertyPage( nSmartTagIdx, aLocale ) ) m_aPropertiesPB.Enable( sal_True ); else diff --git a/desktop/source/app/langselect.cxx b/desktop/source/app/langselect.cxx index d89174e36ae5..d701ee4c4c26 100644 --- a/desktop/source/app/langselect.cxx +++ b/desktop/source/app/langselect.cxx @@ -241,7 +241,7 @@ void LanguageSelection::setDefaultLanguage(const OUString& sLocale) // See #i42730# for rules for determining source of settings // determine script type of locale - LanguageType nLang = LanguageTag(sLocale).getLanguageType(); + LanguageType nLang = LanguageTag::convertToLanguageType(sLocale); sal_uInt16 nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage(nLang); switch (nScriptType) diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx index 69f042e4b0b1..abe3325d76be 100644 --- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx +++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx @@ -403,7 +403,7 @@ namespace drawinglayer aRetval.SetItalic(rFontAttribute.getItalic() ? ITALIC_NORMAL : ITALIC_NONE); aRetval.SetOutline(rFontAttribute.getOutline()); aRetval.SetPitch(rFontAttribute.getMonospaced() ? PITCH_FIXED : PITCH_VARIABLE); - aRetval.SetLanguage(LanguageTag(rLocale).getLanguageType(false)); + aRetval.SetLanguage(LanguageTag::convertToLanguageType( rLocale, false)); #ifdef WIN32 // for WIN32 systems, correct the FontWidth if FontScaling is used diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index e5f45e70ae40..17d9fb1f1a21 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -129,10 +129,10 @@ LanguageType EditView::CheckLanguage( // en-US aLangList[3] = LANGUAGE_ENGLISH_US; #ifdef DEBUG - lang::Locale a0( LanguageTag( aLangList[0] ).getLocale() ); - lang::Locale a1( LanguageTag( aLangList[1] ).getLocale() ); - lang::Locale a2( LanguageTag( aLangList[2] ).getLocale() ); - lang::Locale a3( LanguageTag( aLangList[3] ).getLocale() ); + lang::Locale a0( LanguageTag::convertToLocale( aLangList[0] ) ); + lang::Locale a1( LanguageTag::convertToLocale( aLangList[1] ) ); + lang::Locale a2( LanguageTag::convertToLocale( aLangList[2] ) ); + lang::Locale a3( LanguageTag::convertToLocale( aLangList[3] ) ); #endif sal_Int32 nCount = sizeof (aLangList) / sizeof (aLangList[0]); diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 9a82eb3dc042..f2579f8c123a 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -1781,7 +1781,7 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te i18n::LineBreakHyphenationOptions aHyphOptions( xHyph, Sequence< PropertyValue >(), 1 ); i18n::LineBreakUserOptions aUserOptions; - const i18n::ForbiddenCharacters* pForbidden = GetForbiddenCharsTable()->GetForbiddenCharacters( LanguageTag( aLocale ).getLanguageType(), sal_True ); + const i18n::ForbiddenCharacters* pForbidden = GetForbiddenCharsTable()->GetForbiddenCharacters( LanguageTag::convertToLanguageType( aLocale ), sal_True ); aUserOptions.forbiddenBeginCharacters = pForbidden->beginLine; aUserOptions.forbiddenEndCharacters = pForbidden->endLine; aUserOptions.applyForbiddenRules = ((const SfxBoolItem&)pNode->GetContentAttribs().GetItem( EE_PARA_FORBIDDENRULES )).GetValue(); diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 0252b8d78e3e..72b4c83a3e19 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -1504,7 +1504,7 @@ sal_Bool ImpEditEngine::HasConvertibleTextPortion( LanguageType nSrcLang ) ++nStart; LanguageType nLangFound = pEditEngine->GetLanguage( k, nStart ); #ifdef DEBUG - lang::Locale aLocale( LanguageTag( nLangFound ).getLocale() ); + lang::Locale aLocale( LanguageTag::convertToLocale( nLangFound ) ); #endif bHasConvTxt = (nSrcLang == nLangFound) || (editeng::HangulHanjaConversion::IsChinese( nLangFound ) && @@ -1569,8 +1569,8 @@ void ImpEditEngine::Convert( EditView* pEditView, TextConvWrapper aWrp( Application::GetDefDialogParent(), ::comphelper::getProcessComponentContext(), - LanguageTag( nSrcLang ).getLocale(), - LanguageTag( nDestLang ).getLocale(), + LanguageTag::convertToLocale( nSrcLang ), + LanguageTag::convertToLocale( nDestLang ), pDestFont, nOptions, bIsInteractive, bIsStart, pEditView ); @@ -1696,7 +1696,7 @@ void ImpEditEngine::ImpConvert( OUString &rConvTxt, LanguageType &rConvTxtLang, sal_uInt16 nLangIdx = nEnd > nStart ? nStart + 1 : nStart; LanguageType nLangFound = pEditEngine->GetLanguage( aCurStart.nPara, nLangIdx ); #ifdef DEBUG - lang::Locale aLocale( LanguageTag( nLangFound ).getLocale() ); + lang::Locale aLocale( LanguageTag::convertToLocale( nLangFound ) ); #endif sal_Bool bLangOk = (nLangFound == nSrcLang) || (editeng::HangulHanjaConversion::IsChinese( nLangFound ) && diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index 6c666e35cf7b..2918b22d426c 100644 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -2631,7 +2631,7 @@ bool SvxLanguageItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) if(!(rVal >>= aLocale)) return sal_False; - SetValue( LanguageTag( aLocale ).getLanguageType( false)); + SetValue( LanguageTag::convertToLanguageType( aLocale, false)); } break; } diff --git a/editeng/source/misc/hangulhanja.cxx b/editeng/source/misc/hangulhanja.cxx index 15f9acbf853b..010f21d29341 100644 --- a/editeng/source/misc/hangulhanja.cxx +++ b/editeng/source/misc/hangulhanja.cxx @@ -241,8 +241,8 @@ namespace editeng , m_pUIParent( _pUIParent ) , m_xContext( rxContext ) , m_aSourceLocale( _rSourceLocale ) -, m_nSourceLang( LanguageTag( _rSourceLocale ).getLanguageType() ) -, m_nTargetLang( LanguageTag( _rTargetLocale ).getLanguageType() ) +, m_nSourceLang( LanguageTag::convertToLanguageType( _rSourceLocale ) ) +, m_nTargetLang( LanguageTag::convertToLanguageType( _rTargetLocale ) ) , m_pTargetFont( _pTargetFont ) , m_bIsInteractive( _bIsInteractive ) , m_pAntiImpl( _pAntiImpl ) diff --git a/editeng/source/misc/splwrap.cxx b/editeng/source/misc/splwrap.cxx index 318998405c70..01816b4c7390 100644 --- a/editeng/source/misc/splwrap.cxx +++ b/editeng/source/misc/splwrap.cxx @@ -228,7 +228,7 @@ sal_Int16 SvxSpellWrapper::CheckHyphLang( if (SVX_LANG_NEED_CHECK == ((nVal >> 8) & 0x00FF)) { sal_uInt16 nTmpVal = SVX_LANG_MISSING_DO_WARN; - if (xHyph.is() && xHyph->hasLocale( LanguageTag( nLang ).getLocale() )) + if (xHyph.is() && xHyph->hasLocale( LanguageTag::convertToLocale( nLang ) )) nTmpVal = SVX_LANG_OK; nVal &= 0x00FF; nVal |= nTmpVal << 8; diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index d06b9d204815..d40f481ee606 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -1847,7 +1847,7 @@ sal_Bool SvxAutoCorrect::FindInCplSttExceptList(LanguageType eLang, OUString SvxAutoCorrect::GetAutoCorrFileName( LanguageType eLang, sal_Bool bNewFile, sal_Bool bTst ) const { - OUString sRet, sExt( LanguageTag( eLang ).getBcp47() ); + OUString sRet, sExt( LanguageTag::convertToBcp47( eLang ) ); sExt = "_" + sExt + ".dat"; if( bNewFile ) diff --git a/editeng/source/misc/unolingu.cxx b/editeng/source/misc/unolingu.cxx index a8554d187273..9dced466ec42 100644 --- a/editeng/source/misc/unolingu.cxx +++ b/editeng/source/misc/unolingu.cxx @@ -130,7 +130,7 @@ void ThesDummy_Impl::GetCfgLocales() Locale *pLocale = pLocaleSeq->getArray(); for (sal_Int32 i = 0; i < nLen; ++i) { - pLocale[i] = LanguageTag( pNodeNames[i] ).getLocale(); + pLocale[i] = LanguageTag::convertToLocale( pNodeNames[i] ); } } } @@ -677,7 +677,7 @@ uno::Reference< XDictionary > LinguMgr::GetChangeAll() xChangeAll = uno::Reference< XDictionary > ( _xDicList->createDictionary( "ChangeAllList", - LanguageTag( LANGUAGE_NONE ).getLocale(), + LanguageTag::convertToLocale( LANGUAGE_NONE ), DictionaryType_NEGATIVE, String() ), UNO_QUERY ); } return xChangeAll; @@ -705,7 +705,7 @@ uno::Reference< XDictionary > LinguMgr::GetStandard() try { xTmp = xTmpDicList->createDictionary( aDicName, - LanguageTag( LANGUAGE_NONE ).getLocale(), + LanguageTag::convertToLocale( LANGUAGE_NONE ), DictionaryType_POSITIVE, linguistic::GetWritableDictionaryURL( aDicName ) ); } diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx index c1b8fa8bd255..a72f2bc9c30a 100644 --- a/editeng/source/outliner/outlvw.cxx +++ b/editeng/source/outliner/outlvw.cxx @@ -1575,7 +1575,7 @@ bool EDITENG_DLLPUBLIC GetStatusValueForThesaurusFromContext( aText = pEditEngine->GetText( aTextSel ); aTextSel.Adjust(); LanguageType nLang = pEditEngine->GetLanguage( aTextSel.nStartPara, aTextSel.nStartPos ); - OUString aLangText( LanguageTag( nLang ).getBcp47() ); + OUString aLangText( LanguageTag::convertToBcp47( nLang ) ); // set word and locale to look up as status value OUString aStatusVal= aText + "#" + aLangText; diff --git a/editeng/source/uno/UnoForbiddenCharsTable.cxx b/editeng/source/uno/UnoForbiddenCharsTable.cxx index 12dcee9be9a0..08d29aa5ab58 100644 --- a/editeng/source/uno/UnoForbiddenCharsTable.cxx +++ b/editeng/source/uno/UnoForbiddenCharsTable.cxx @@ -52,7 +52,7 @@ ForbiddenCharacters SvxUnoForbiddenCharsTable::getForbiddenCharacters( const Loc if(!mxForbiddenChars.is()) throw RuntimeException(); - const LanguageType eLang = LanguageTag( rLocale ).getLanguageType(); + const LanguageType eLang = LanguageTag::convertToLanguageType( rLocale ); const ForbiddenCharacters* pForbidden = mxForbiddenChars->GetForbiddenCharacters( eLang, sal_False ); if(!pForbidden) throw NoSuchElementException(); @@ -68,7 +68,7 @@ sal_Bool SvxUnoForbiddenCharsTable::hasForbiddenCharacters( const Locale& rLocal if(!mxForbiddenChars.is()) return sal_False; - const LanguageType eLang = LanguageTag( rLocale ).getLanguageType(); + const LanguageType eLang = LanguageTag::convertToLanguageType( rLocale ); const ForbiddenCharacters* pForbidden = mxForbiddenChars->GetForbiddenCharacters( eLang, sal_False ); return NULL != pForbidden; @@ -82,7 +82,7 @@ void SvxUnoForbiddenCharsTable::setForbiddenCharacters(const Locale& rLocale, co if(!mxForbiddenChars.is()) throw RuntimeException(); - const LanguageType eLang = LanguageTag( rLocale ).getLanguageType(); + const LanguageType eLang = LanguageTag::convertToLanguageType( rLocale ); mxForbiddenChars->SetForbiddenCharacters( eLang, rForbiddenCharacters ); onChange(); @@ -96,7 +96,7 @@ void SvxUnoForbiddenCharsTable::removeForbiddenCharacters( const Locale& rLocale if(!mxForbiddenChars.is()) throw RuntimeException(); - const LanguageType eLang = LanguageTag( rLocale ).getLanguageType(); + const LanguageType eLang = LanguageTag::convertToLanguageType( rLocale ); mxForbiddenChars->ClearForbiddenCharacters( eLang ); onChange(); diff --git a/forms/source/component/FormattedField.cxx b/forms/source/component/FormattedField.cxx index 773c7a5603db..8e74136c109b 100644 --- a/forms/source/component/FormattedField.cxx +++ b/forms/source/component/FormattedField.cxx @@ -845,7 +845,7 @@ void OFormattedModel::write(const Reference<XObjectOutputStream>& _rxOutStream) if (isA(aLocale, static_cast<Locale*>(NULL))) { Locale* pLocale = (Locale*)aLocale.getValue(); - eFormatLanguage = LanguageTag( *pLocale ).getLanguageType( false); + eFormatLanguage = LanguageTag::convertToLanguageType( *pLocale, false); } } @@ -928,7 +928,7 @@ void OFormattedModel::read(const Reference<XObjectInputStream>& _rxInStream) thr if (xFormats.is()) { - Locale aDescriptionLanguage( LanguageTag(eDescriptionLanguage).getLocale()); + Locale aDescriptionLanguage( LanguageTag::convertToLocale(eDescriptionLanguage)); nKey = xFormats->queryKey(sFormatDescription, aDescriptionLanguage, sal_False); if (nKey == (sal_Int32)-1) diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx index d012b6dd4eee..ac75295c410a 100644 --- a/framework/source/services/substitutepathvars.cxx +++ b/framework/source/services/substitutepathvars.cxx @@ -1187,7 +1187,7 @@ void SubstitutePathVariables::SetPredefinedPathVariables( PredefinedPathVariable // Detect the language type of the current office aPreDefPathVariables.m_eLanguageType = LANGUAGE_ENGLISH_US; OUString aLocaleStr( utl::ConfigManager::getLocale() ); - aPreDefPathVariables.m_eLanguageType = LanguageTag( aLocaleStr ).getLanguageType(); + aPreDefPathVariables.m_eLanguageType = LanguageTag::convertToLanguageType( aLocaleStr ); // We used to have an else branch here with a LOG_ERROR, but that // always fired in some unit tests when this code was built with // debug=t, so it seems fairly pointless, especially as diff --git a/i18nlangtag/source/isolang/inunx.cxx b/i18nlangtag/source/isolang/inunx.cxx index a20a64dae1e2..9e30a8faec1c 100644 --- a/i18nlangtag/source/isolang/inunx.cxx +++ b/i18nlangtag/source/isolang/inunx.cxx @@ -99,7 +99,7 @@ static void getPlatformSystemLanguageImpl( LanguageType& rSystemLanguage, if ( osl_getProcessLocale(&procLocale) == osl_Process_E_None ) { - nLang = LanguageTag( *procLocale ).getLanguageType(); + nLang = LanguageTag::convertToLanguageType( *procLocale ); OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER(); rSystemLanguage = nLang; #ifdef DEBUG 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; } diff --git a/linguistic/source/convdic.cxx b/linguistic/source/convdic.cxx index c21df30b5879..323422af4045 100644 --- a/linguistic/source/convdic.cxx +++ b/linguistic/source/convdic.cxx @@ -357,7 +357,7 @@ Locale SAL_CALL ConvDic::getLocale( ) throw (RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); - return LanguageTag( nLanguage ).getLocale(); + return LanguageTag::convertToLocale( nLanguage ); } diff --git a/linguistic/source/convdicxml.cxx b/linguistic/source/convdicxml.cxx index efb73c810460..91a30d367bad 100644 --- a/linguistic/source/convdicxml.cxx +++ b/linguistic/source/convdicxml.cxx @@ -223,7 +223,7 @@ void ConvDicXMLDictionaryContext_Impl::StartElement( OUString aValue = rxAttrList->getValueByIndex(i); if ( nPrefix == XML_NAMESPACE_TCD && aLocalName == "lang" ) - nLanguage = LanguageTag( aValue ).getLanguageType(); + nLanguage = LanguageTag::convertToLanguageType( aValue ); else if ( nPrefix == XML_NAMESPACE_TCD && aLocalName == "conversion-type" ) nConversionType = GetConversionTypeFromText( aValue ); } @@ -325,7 +325,7 @@ sal_uInt32 ConvDicXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum /*eCl _GetNamespaceMap().GetNameByKey( XML_NAMESPACE_TCD ) ); AddAttributeASCII( XML_NAMESPACE_TCD, "package", "org.openoffice.Office" ); - OUString aIsoLang( LanguageTag( rDic.nLanguage ).getBcp47() ); + OUString aIsoLang( LanguageTag::convertToBcp47( rDic.nLanguage ) ); AddAttribute( XML_NAMESPACE_TCD, "lang", aIsoLang ); OUString aConvType( ConversionTypeToText( rDic.nConversionType ) ); AddAttribute( XML_NAMESPACE_TCD, "conversion-type", aConvType ); diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx index 5af73a82de33..ca490f469070 100644 --- a/linguistic/source/dicimp.cxx +++ b/linguistic/source/dicimp.cxx @@ -472,7 +472,7 @@ sal_uLong DictionaryNeo::saveEntries(const OUString &rURL) else { OStringBuffer aLine(RTL_CONSTASCII_STRINGPARAM("lang: ")); - aLine.append(OUStringToOString(LanguageTag(nLanguage).getBcp47(), eEnc)); + aLine.append(OUStringToOString(LanguageTag::convertToBcp47(nLanguage), eEnc)); pStream->WriteLine(aLine.makeStringAndClear()); } if (0 != (nErr = pStream->GetError())) @@ -818,7 +818,7 @@ Locale SAL_CALL DictionaryNeo::getLocale( ) throw(RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); - return LanguageTag( nLanguage ).getLocale(); + return LanguageTag::convertToLocale( nLanguage ); } void SAL_CALL DictionaryNeo::setLocale( const Locale& aLocale ) diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx index 4c08a9eed79d..d701126f5c2c 100644 --- a/linguistic/source/gciterator.cxx +++ b/linguistic/source/gciterator.cxx @@ -444,7 +444,7 @@ uno::Reference< linguistic2::XProofreader > GrammarCheckingIterator::GetGrammarC m_bGCServicesChecked = sal_True; } - const LanguageType nLang = LanguageTag( rLocale ).getLanguageType( false); + const LanguageType nLang = LanguageTag::convertToLanguageType( rLocale, false); GCImplNames_t::const_iterator aLangIt( m_aGCImplNamesByLang.find( nLang ) ); if (aLangIt != m_aGCImplNamesByLang.end()) // matching configured language found? { @@ -1012,7 +1012,7 @@ void GrammarCheckingIterator::GetConfiguredGCSvcs_Impl() { // only the first entry is used, there should be only one grammar checker per language const OUString aImplName( aImplNames[0] ); - const LanguageType nLang = LanguageTag( pElementNames[i] ).getLanguageType(); + const LanguageType nLang = LanguageTag::convertToLanguageType( pElementNames[i] ); aTmpGCImplNamesByLang[ nLang ] = aImplName; } } diff --git a/linguistic/source/hyphdsp.cxx b/linguistic/source/hyphdsp.cxx index 7b5c0a96a714..3e5c2609ab96 100644 --- a/linguistic/source/hyphdsp.cxx +++ b/linguistic/source/hyphdsp.cxx @@ -224,7 +224,7 @@ Sequence< Locale > SAL_CALL HyphenatorDispatcher::getLocales() HyphSvcByLangMap_t::const_iterator aIt; for (aIt = aSvcMap.begin(); aIt != aSvcMap.end(); ++aIt) { - *pLocales++ = LanguageTag( aIt->first ).getLocale(); + *pLocales++ = LanguageTag::convertToLocale( aIt->first ); } return aLocales; } diff --git a/linguistic/source/hyphdta.cxx b/linguistic/source/hyphdta.cxx index 76d91ef5a2b1..f5ce5b157acd 100644 --- a/linguistic/source/hyphdta.cxx +++ b/linguistic/source/hyphdta.cxx @@ -83,7 +83,7 @@ Locale SAL_CALL HyphenatedWord::getLocale() { MutexGuard aGuard( GetLinguMutex() ); - return LanguageTag( nLanguage ).getLocale(); + return LanguageTag::convertToLocale( nLanguage ); } @@ -149,7 +149,7 @@ Locale SAL_CALL PossibleHyphens::getLocale() throw(RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); - return LanguageTag( nLanguage ).getLocale(); + return LanguageTag::convertToLocale( nLanguage ); } diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx index 3cb177d72337..e3d4639b6e05 100644 --- a/linguistic/source/lngsvcmgr.cxx +++ b/linguistic/source/lngsvcmgr.cxx @@ -137,7 +137,7 @@ static uno::Sequence< lang::Locale > GetAvailLocales( for (i = 0; aIt != aLanguages.end(); ++aIt, ++i) { LanguageType nLang = *aIt; - pRes[i] = LanguageTag( nLang ).getLocale(); + pRes[i] = LanguageTag::convertToLocale( nLang ); } } @@ -612,7 +612,7 @@ namespace { Sequence< OUString > aRes; - OUString aCfgLocaleStr( LanguageTag( rAvailLocale ).getBcp47() ); + OUString aCfgLocaleStr( LanguageTag::convertToBcp47( rAvailLocale ) ); Sequence< OUString > aNodeNames( rCfg.GetNodeNames(rLastFoundList) ); sal_Bool bFound = lcl_FindEntry( aCfgLocaleStr, aNodeNames); @@ -880,10 +880,10 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames ) LanguageType nLang = LANGUAGE_NONE; if (!aKeyText.isEmpty()) - nLang = LanguageTag( aKeyText ).getLanguageType(); + nLang = LanguageTag::convertToLanguageType( aKeyText ); GetSpellCheckerDsp_Impl( sal_False ); // don't set service list, it will be done below - pSpellDsp->SetServiceList( LanguageTag(nLang).getLocale(), aSvcImplNames ); + pSpellDsp->SetServiceList( LanguageTag::convertToLocale(nLang), aSvcImplNames ); } } else if (rName.startsWith( aGrammarCheckerList )) @@ -905,12 +905,12 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames ) LanguageType nLang = LANGUAGE_NONE; if (!aKeyText.isEmpty()) - nLang = LanguageTag( aKeyText ).getLanguageType(); + nLang = LanguageTag::convertToLanguageType( aKeyText ); if (SvtLinguConfig().HasGrammarChecker()) { GetGrammarCheckerDsp_Impl( sal_False ); // don't set service list, it will be done below - pGrammarDsp->SetServiceList( LanguageTag(nLang).getLocale(), aSvcImplNames ); + pGrammarDsp->SetServiceList( LanguageTag::convertToLocale(nLang), aSvcImplNames ); } } } @@ -933,10 +933,10 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames ) LanguageType nLang = LANGUAGE_NONE; if (!aKeyText.isEmpty()) - nLang = LanguageTag( aKeyText ).getLanguageType(); + nLang = LanguageTag::convertToLanguageType( aKeyText ); GetHyphenatorDsp_Impl( sal_False ); // don't set service list, it will be done below - pHyphDsp->SetServiceList( LanguageTag(nLang).getLocale(), aSvcImplNames ); + pHyphDsp->SetServiceList( LanguageTag::convertToLocale(nLang), aSvcImplNames ); } } else if (rName.startsWith( aThesaurusList )) @@ -958,10 +958,10 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames ) LanguageType nLang = LANGUAGE_NONE; if (!aKeyText.isEmpty()) - nLang = LanguageTag( aKeyText ).getLanguageType(); + nLang = LanguageTag::convertToLanguageType( aKeyText ); GetThesaurusDsp_Impl( sal_False ); // don't set service list, it will be done below - pThesDsp->SetServiceList( LanguageTag(nLang).getLocale(), aSvcImplNames ); + pThesDsp->SetServiceList( LanguageTag::convertToLocale(nLang), aSvcImplNames ); } } else @@ -1312,7 +1312,7 @@ void LngSvcMgr::SetCfgServiceLists( SpellCheckerDispatcher &rSpellDsp ) String aLocaleStr( pNames[i] ); xub_StrLen nSeparatorPos = aLocaleStr.SearchBackward( sal_Unicode( '/' ) ); aLocaleStr = aLocaleStr.Copy( nSeparatorPos + 1 ); - rSpellDsp.SetServiceList( LanguageTag(aLocaleStr).getLocale(), aSvcImplNames ); + rSpellDsp.SetServiceList( LanguageTag::convertToLocale(aLocaleStr), aSvcImplNames ); } } } @@ -1354,7 +1354,7 @@ void LngSvcMgr::SetCfgServiceLists( GrammarCheckingIterator &rGrammarDsp ) String aLocaleStr( pNames[i] ); xub_StrLen nSeparatorPos = aLocaleStr.SearchBackward( sal_Unicode( '/' ) ); aLocaleStr = aLocaleStr.Copy( nSeparatorPos + 1 ); - rGrammarDsp.SetServiceList( LanguageTag(aLocaleStr).getLocale(), aSvcImplNames ); + rGrammarDsp.SetServiceList( LanguageTag::convertToLocale(aLocaleStr), aSvcImplNames ); } } } @@ -1396,7 +1396,7 @@ void LngSvcMgr::SetCfgServiceLists( HyphenatorDispatcher &rHyphDsp ) String aLocaleStr( pNames[i] ); xub_StrLen nSeparatorPos = aLocaleStr.SearchBackward( sal_Unicode( '/' ) ); aLocaleStr = aLocaleStr.Copy( nSeparatorPos + 1 ); - rHyphDsp.SetServiceList( LanguageTag(aLocaleStr).getLocale(), aSvcImplNames ); + rHyphDsp.SetServiceList( LanguageTag::convertToLocale(aLocaleStr), aSvcImplNames ); } } } @@ -1434,7 +1434,7 @@ void LngSvcMgr::SetCfgServiceLists( ThesaurusDispatcher &rThesDsp ) String aLocaleStr( pNames[i] ); xub_StrLen nSeparatorPos = aLocaleStr.SearchBackward( sal_Unicode( '/' ) ); aLocaleStr = aLocaleStr.Copy( nSeparatorPos + 1 ); - rThesDsp.SetServiceList( LanguageTag(aLocaleStr).getLocale(), aSvcImplNames ); + rThesDsp.SetServiceList( LanguageTag::convertToLocale(aLocaleStr), aSvcImplNames ); } } } @@ -1904,7 +1904,7 @@ uno::Sequence< OUString > SAL_CALL uno::Sequence< OUString > aSvcImplNames; - OUString aCfgLocale( LanguageTag( rLocale).getBcp47() ); + OUString aCfgLocale( LanguageTag::convertToBcp47( rLocale) ); uno::Sequence< uno::Any > aValues; uno::Sequence< OUString > aNames( 1 ); diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx index 91c59b5bae7b..c2731756fcaa 100644 --- a/linguistic/source/misc.cxx +++ b/linguistic/source/misc.cxx @@ -88,7 +88,7 @@ LanguageType LinguLocaleToLanguage( const ::com::sun::star::lang::Locale& rLocal { if ( rLocale.Language.isEmpty() ) return LANGUAGE_NONE; - return LanguageTag( rLocale ).getLanguageType(); + return LanguageTag::convertToLanguageType( rLocale ); } @@ -96,7 +96,7 @@ LanguageType LinguLocaleToLanguage( const ::com::sun::star::lang::Locale& rLocal { if (nLanguage == LANGUAGE_NONE) return ::com::sun::star::lang::Locale(); - return LanguageTag( nLanguage).getLocale(); + return LanguageTag::convertToLocale( nLanguage); } 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); } diff --git a/linguistic/source/spelldta.cxx b/linguistic/source/spelldta.cxx index 82178a3df94e..80c40a0cc6f4 100644 --- a/linguistic/source/spelldta.cxx +++ b/linguistic/source/spelldta.cxx @@ -212,7 +212,7 @@ Locale SAL_CALL SpellAlternatives::getLocale() throw(RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); - return LanguageTag( nLanguage ).getLocale(); + return LanguageTag::convertToLocale( nLanguage ); } diff --git a/linguistic/source/thesdsp.cxx b/linguistic/source/thesdsp.cxx index c8d31cadc5f2..49dfc316c8be 100644 --- a/linguistic/source/thesdsp.cxx +++ b/linguistic/source/thesdsp.cxx @@ -89,7 +89,7 @@ Sequence< Locale > SAL_CALL ThesSvcByLangMap_t::const_iterator aIt; for (aIt = aSvcMap.begin(); aIt != aSvcMap.end(); ++aIt) { - *pLocales++ = LanguageTag( aIt->first ).getLocale(); + *pLocales++ = LanguageTag::convertToLocale( aIt->first ); } return aLocales; } diff --git a/oox/source/docprop/docprophandler.cxx b/oox/source/docprop/docprophandler.cxx index 467151dc2c16..56242e1154a6 100644 --- a/oox/source/docprop/docprophandler.cxx +++ b/oox/source/docprop/docprophandler.cxx @@ -409,7 +409,7 @@ void SAL_CALL OOXMLDocPropHandler::characters( const OUString& aChars ) case DC_TOKEN( language ): if ( aChars.getLength() >= 2 ) - m_xDocProp->setLanguage( LanguageTag( aChars).getLocale() ); + m_xDocProp->setLanguage( LanguageTag::convertToLocale( aChars) ); break; case COREPR_TOKEN( lastModifiedBy ): diff --git a/reportdesign/source/core/api/ReportComponent.cxx b/reportdesign/source/core/api/ReportComponent.cxx index 998aefb9c936..758102a89158 100644 --- a/reportdesign/source/core/api/ReportComponent.cxx +++ b/reportdesign/source/core/api/ReportComponent.cxx @@ -84,11 +84,11 @@ OFormatProperties::OFormatProperties() using namespace ::com::sun::star::i18n::ScriptType; aLinguConfig.GetProperty(OUString("DefaultLocale")) >>= aCharLocale; - LanguageType eCurLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag(aCharLocale).getLanguageType(false), LATIN); + LanguageType eCurLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType( aCharLocale, false), LATIN); aLinguConfig.GetProperty(OUString("DefaultLocale_CJK")) >>= aCharLocaleAsian; - LanguageType eCurLangCJK = MsLangId::resolveSystemLanguageByScriptType(LanguageTag(aCharLocaleAsian).getLanguageType(false), ASIAN); + LanguageType eCurLangCJK = MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType( aCharLocaleAsian, false), ASIAN); aLinguConfig.GetProperty(OUString("DefaultLocale_CTL")) >>= aCharLocaleComplex; - LanguageType eCurLangCTL = MsLangId::resolveSystemLanguageByScriptType(LanguageTag(aCharLocaleComplex).getLanguageType(false), COMPLEX); + LanguageType eCurLangCTL = MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType( aCharLocaleComplex, false), COMPLEX); Font aLatin,aCJK,aCTL; lcl_getDefaultFonts(aLatin,aCJK,aCTL,eCurLang,eCurLangCJK,eCurLangCTL); diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx index 20ab937d556d..3cc1eefd7380 100644 --- a/sc/source/core/tool/addincol.cxx +++ b/sc/source/core/tool/addincol.cxx @@ -114,7 +114,7 @@ const ::std::vector<ScUnoAddInFuncData::LocalizedName>& ScUnoAddInFuncData::GetC for (sal_Int32 i=0; i<nSeqLen; i++) { maCompNames.push_back( LocalizedName( - LanguageTag( pArray[i].Locale).getBcp47( false), + LanguageTag::convertToBcp47( pArray[i].Locale, false), pArray[i].Name)); } } diff --git a/sc/source/filter/oox/numberformatsbuffer.cxx b/sc/source/filter/oox/numberformatsbuffer.cxx index e6f38151d419..d6992f5c2330 100644 --- a/sc/source/filter/oox/numberformatsbuffer.cxx +++ b/sc/source/filter/oox/numberformatsbuffer.cxx @@ -2023,7 +2023,7 @@ void NumberFormatsBuffer::insertBuiltinFormats() aBuiltinMap[ OUString::createFromAscii( pTable->mpcLocale ) ] = pTable; // convert locale string to locale struct - Locale aSysLocale( LanguageTag( maLocaleStr).getLocale()); + Locale aSysLocale( LanguageTag::convertToLocale( maLocaleStr)); // build a list of table pointers for the current locale, with all parent tables typedef ::std::vector< const BuiltinFormatTable* > BuiltinVec; 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; diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 62c6d00127e5..58a819f23aba 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -1214,7 +1214,7 @@ void SAL_CALL SdXImpressDocument::setPropertyValue( const OUString& aPropertyNam if(!(aValue >>= aLocale)) throw lang::IllegalArgumentException(); - mpDoc->SetLanguage( LanguageTag(aLocale).getLanguageType(), EE_CHAR_LANGUAGE ); + mpDoc->SetLanguage( LanguageTag::convertToLanguageType(aLocale), EE_CHAR_LANGUAGE ); break; } case WID_MODEL_TABSTOP: @@ -1287,7 +1287,7 @@ uno::Any SAL_CALL SdXImpressDocument::getPropertyValue( const OUString& Property case WID_MODEL_LANGUAGE: { LanguageType eLang = mpDoc->GetLanguage( EE_CHAR_LANGUAGE ); - aAny <<= LanguageTag( eLang).getLocale(); + aAny <<= LanguageTag::convertToLocale( eLang); break; } case WID_MODEL_TABSTOP: diff --git a/sd/source/ui/unoidl/unopool.cxx b/sd/source/ui/unoidl/unopool.cxx index 983ce76766ec..1c1157b9bcbd 100644 --- a/sd/source/ui/unoidl/unopool.cxx +++ b/sd/source/ui/unoidl/unopool.cxx @@ -35,7 +35,7 @@ LanguageType SdUnoGetLanguage( const lang::Locale& rLocale ) if ( rLocale.Language.getLength() == 0 ) 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? diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index 5579fe337118..c9302308964d 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -574,7 +574,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) LanguageType eLang = GetDoc()->GetLanguage( EE_CHAR_LANGUAGE ); Reference< XThesaurus > xThesaurus( LinguMgr::GetThesaurus() ); - if (!xThesaurus.is() || eLang == LANGUAGE_NONE || !xThesaurus->hasLocale( LanguageTag( eLang).getLocale()) ) + if (!xThesaurus.is() || eLang == LANGUAGE_NONE || !xThesaurus->hasLocale( LanguageTag::convertToLocale( eLang)) ) rSet.DisableItem( SID_THESAURUS ); } } diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index fc6f30f60cf3..df93540db347 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -1059,7 +1059,7 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet ) LanguageType eLang = GetDoc()->GetLanguage( EE_CHAR_LANGUAGE ); Reference< XThesaurus > xThesaurus( LinguMgr::GetThesaurus() ); - if (!xThesaurus.is() || eLang == LANGUAGE_NONE || !xThesaurus->hasLocale( LanguageTag( eLang).getLocale())) + if (!xThesaurus.is() || eLang == LANGUAGE_NONE || !xThesaurus->hasLocale( LanguageTag::convertToLocale( eLang))) rSet.DisableItem( SID_THESAURUS ); } } diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx index f1e96c6645d0..fe08d67a0fcd 100644 --- a/sfx2/source/doc/SfxDocumentMetaData.cxx +++ b/sfx2/source/doc/SfxDocumentMetaData.cxx @@ -1524,7 +1524,7 @@ void SAL_CALL SfxDocumentMetaData::setLanguage(const css::lang::Locale & the_value) throw (css::uno::RuntimeException) { - OUString text( LanguageTag( the_value).getBcp47( false)); + OUString text( LanguageTag::convertToBcp47( the_value, false)); setMetaTextAndNotify("dc:language", text); } diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index 78d8ac256ea8..136acac9b549 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -401,7 +401,7 @@ void SfxDocTplService_Impl::init_Impl() getDefaultLocale(); // convert locale to string - OUString aLang = LanguageTag( maLocale).getBcp47(); + OUString aLang = LanguageTag::convertToBcp47( maLocale); // set maRootContent to the root of the templates hierarchy. Create the // entry if necessary diff --git a/sfx2/source/menu/thessubmenu.cxx b/sfx2/source/menu/thessubmenu.cxx index 3c22420ba4fd..7c56a19b2d58 100644 --- a/sfx2/source/menu/thessubmenu.cxx +++ b/sfx2/source/menu/thessubmenu.cxx @@ -53,7 +53,7 @@ void SfxThesSubMenuHelper::GetLocale( xub_StrLen nDelimPos ) { String aIsoLang( rLookUpString.Copy( nDelimPos + 1) ); - rLocale = LanguageTag( aIsoLang).getLocale(); + rLocale = LanguageTag::convertToLocale( aIsoLang); } diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx index aa3a66f09d6e..169ce5f032d5 100644 --- a/starmath/source/parse.cxx +++ b/starmath/source/parse.cxx @@ -2467,7 +2467,7 @@ void SmParser::Error(SmParseError eError) SmParser::SmParser() - : m_aDotLoc( LanguageTag( LANGUAGE_ENGLISH_US ).getLocale() ) + : m_aDotLoc( LanguageTag::convertToLocale( LANGUAGE_ENGLISH_US ) ) { m_eConversion = CONVERT_NONE; bImportSymNames = m_bExportSymNames = false; diff --git a/svl/source/config/asiancfg.cxx b/svl/source/config/asiancfg.cxx index 695f7623eb9e..b644705aef97 100644 --- a/svl/source/config/asiancfg.cxx +++ b/svl/source/config/asiancfg.cxx @@ -50,7 +50,7 @@ OUString toString(css::lang::Locale const & locale) { "Locale language \"" << locale.Language << "\" contains \"-\""); SAL_WARN_IF( locale.Country.indexOf('-') != -1, "svl", "Locale country \"" << locale.Country << "\" contains \"-\""); - return LanguageTag( locale).getBcp47( false); + return LanguageTag::convertToBcp47( locale, false); } } @@ -105,7 +105,7 @@ css::uno::Sequence< css::lang::Locale > SvxAsianConfig::GetStartEndCharLocales() getElementNames()); css::uno::Sequence< css::lang::Locale > ls(ns.getLength()); for (sal_Int32 i = 0; i < ns.getLength(); ++i) { - ls[i] = LanguageTag( ns[i]).getLocale( false); + ls[i] = LanguageTag::convertToLocale( ns[i], false); } return ls; } diff --git a/svl/source/config/languageoptions.cxx b/svl/source/config/languageoptions.cxx index a095ac5b731e..687c99a81d3a 100644 --- a/svl/source/config/languageoptions.cxx +++ b/svl/source/config/languageoptions.cxx @@ -204,7 +204,7 @@ LanguageType SvtSystemLanguageOptions::GetWin16SystemLanguage() const { if( m_sWin16SystemLocale.isEmpty() ) return LANGUAGE_NONE; - return LanguageTag( m_sWin16SystemLocale ).getLanguageType(); + return LanguageTag::convertToLanguageType( m_sWin16SystemLocale ); } bool SvtSystemLanguageOptions::isKeyboardLayoutTypeInstalled(sal_Int16 scriptType) const diff --git a/svl/source/items/srchitem.cxx b/svl/source/items/srchitem.cxx index c3ad82c5c160..a75f83c46f89 100644 --- a/svl/source/items/srchitem.cxx +++ b/svl/source/items/srchitem.cxx @@ -432,7 +432,7 @@ bool SvxSearchItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMembe { sal_Int16 nLocale; if (!aSearchOpt.Locale.Language.isEmpty() || !aSearchOpt.Locale.Country.isEmpty() ) - nLocale = LanguageTag( aSearchOpt.Locale ).getLanguageType(); + nLocale = LanguageTag::convertToLanguageType( aSearchOpt.Locale ); else nLocale = LANGUAGE_NONE; rVal <<= nLocale; @@ -581,7 +581,7 @@ bool SvxSearchItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nM } else { - aSearchOpt.Locale = LanguageTag( nInt).getLocale(); + aSearchOpt.Locale = LanguageTag::convertToLocale( nInt); } } break; diff --git a/svl/source/numbers/numfmuno.cxx b/svl/source/numbers/numfmuno.cxx index 95b012e9404a..317abfa7fa17 100644 --- a/svl/source/numbers/numfmuno.cxx +++ b/svl/source/numbers/numfmuno.cxx @@ -101,7 +101,7 @@ static LanguageType lcl_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? diff --git a/svl/source/numbers/supservs.cxx b/svl/source/numbers/supservs.cxx index 198c5f67c2b4..70cce53830b0 100644 --- a/svl/source/numbers/supservs.cxx +++ b/svl/source/numbers/supservs.cxx @@ -96,7 +96,7 @@ void SAL_CALL SvNumberFormatsSupplierServiceObject::initialize( const Sequence< { Locale aLocale; *pArgs >>= aLocale; - eNewFormatterLanguage = LanguageTag( aLocale).getLanguageType( false); + eNewFormatterLanguage = LanguageTag::convertToLanguageType( aLocale, false); } #ifdef DBG_UTIL else diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index f75748ba6202..00a9a35be182 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -3704,7 +3704,7 @@ void SvNumberFormatter::ImpInitCurrencyTable() sal_uInt16 nLegacyOnlyCurrencyPos = 0; for ( sal_Int32 nLocale = 0; nLocale < nLocaleCount; nLocale++ ) { - LanguageType eLang = LanguageTag( pLocales[nLocale]).getLanguageType( false); + LanguageType eLang = LanguageTag::convertToLanguageType( pLocales[nLocale], false); rInstalledLocales.insert( eLang); pLocaleData->setLanguageTag( LanguageTag( pLocales[nLocale]) ); Sequence< Currency2 > aCurrSeq = pLocaleData->getAllCurrencies(); diff --git a/svtools/langsupport/langsupport.cxx b/svtools/langsupport/langsupport.cxx index 226187a5d020..12269cada3d7 100644 --- a/svtools/langsupport/langsupport.cxx +++ b/svtools/langsupport/langsupport.cxx @@ -56,7 +56,7 @@ SAL_IMPLEMENT_MAIN() continue; } - OUString sTag( LanguageTag( eLang).getBcp47()); + OUString sTag( LanguageTag::convertToBcp47( eLang)); std::cout << OUStringToOString(sTag, osl_getThreadTextEncoding()).getStr() << std::endl; diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx index b83443d2754e..4fcaa7399855 100644 --- a/svtools/source/misc/langtab.cxx +++ b/svtools/source/misc/langtab.cxx @@ -143,7 +143,7 @@ const OUString SvtLanguageTable::GetString( const LanguageType eType, bool bUser return ResStringArray::GetString( nPos ); //Rather than return a fairly useless "Unknown" name, return a geeky but usable-in-a-pinch lang-tag - OUString sLangTag(LanguageTag(eType).getBcp47()); + OUString sLangTag(LanguageTag::convertToBcp47(eType)); SAL_WARN("svtools.misc", "Language: 0x" << std::hex << eType << " with unknown name, so returning lang-tag of: " diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx index 7291b1728cbd..093f1285d6a5 100644 --- a/svx/source/dialog/langbox.cxx +++ b/svx/source/dialog/langbox.cxx @@ -80,7 +80,7 @@ static Sequence< sal_Int16 > lcl_LocaleSeqToLangSeq( Sequence< Locale > &rSeq ) sal_Int16 *pLang = aLangs.getArray(); for (sal_Int32 i = 0; i < nCount; ++i) { - pLang[i] = LanguageTag( pLocale[i] ).getLanguageType(); + pLang[i] = LanguageTag::convertToLanguageType( pLocale[i] ); } diff --git a/svx/source/form/fmcontrollayout.cxx b/svx/source/form/fmcontrollayout.cxx index 204338ea74e5..dc930f295173 100644 --- a/svx/source/form/fmcontrollayout.cxx +++ b/svx/source/form/fmcontrollayout.cxx @@ -176,7 +176,7 @@ namespace svxform } // retrieve a default font for this locale, and set it at the control - Font aFont = OutputDevice::GetDefaultFont( DEFAULTFONT_SANS, LanguageTag( aDocumentCharLocale ).getLanguageType(), DEFAULTFONT_FLAGS_ONLYONE ); + Font aFont = OutputDevice::GetDefaultFont( DEFAULTFONT_SANS, LanguageTag::convertToLanguageType( aDocumentCharLocale ), DEFAULTFONT_FLAGS_ONLYONE ); FontDescriptor aFontDesc = VCLUnoHelper::CreateFontDescriptor( aFont ); _rxModel->setPropertyValue( OUString( "FontDescriptor" ), diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx index e6af8f9b1f4c..009600c64268 100644 --- a/sw/source/core/bastyp/init.cxx +++ b/sw/source/core/bastyp/init.cxx @@ -816,7 +816,7 @@ void SwCalendarWrapper::LoadDefaultCalendar( sal_uInt16 eLang ) { sUniqueId.Erase(); if( eLang != nLang ) - loadDefaultCalendar( LanguageTag( nLang = eLang ).getLocale()); + loadDefaultCalendar( LanguageTag::convertToLocale( nLang = eLang )); } LanguageType GetAppLanguage() diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx index ab89350ab04d..615ff3091a4d 100644 --- a/sw/source/core/doc/docsort.cxx +++ b/sw/source/core/doc/docsort.cxx @@ -82,7 +82,7 @@ void SwSortElement::Init( SwDoc* pD, const SwSortOptions& rOpt, nLang = GetAppLanguage(); break; } - pLocale = new lang::Locale( LanguageTag( nLang ).getLocale() ); + pLocale = new lang::Locale( LanguageTag::convertToLocale( nLang ) ); pSortCollator = new CollatorWrapper( ::comphelper::getProcessComponentContext() ); } diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx index fb2e3b3d580a..d1fbe7965e7e 100644 --- a/sw/source/core/fields/authfld.cxx +++ b/sw/source/core/fields/authfld.cxx @@ -445,7 +445,7 @@ bool SwAuthorityFieldType::PutValue( const Any& rAny, sal_uInt16 nWhichId ) { com::sun::star::lang::Locale aLocale; if( 0 != (bRet = rAny >>= aLocale )) - SetLanguage( LanguageTag( aLocale ).getLanguageType()); + SetLanguage( LanguageTag::convertToLanguageType( aLocale )); } break; diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx index 22e7091e00d4..20e4975f9ebe 100644 --- a/sw/source/core/tox/txmsrt.cxx +++ b/sw/source/core/tox/txmsrt.cxx @@ -75,7 +75,7 @@ void SwTOXInternational::Init() { pIndexWrapper = new IndexEntrySupplierWrapper(); - const lang::Locale aLcl( LanguageTag( eLang ).getLocale() ); + const lang::Locale aLcl( LanguageTag::convertToLocale( eLang ) ); pIndexWrapper->SetLocale( aLcl ); if(!sSortAlgorithm.Len()) diff --git a/sw/source/core/unocore/unoflatpara.cxx b/sw/source/core/unocore/unoflatpara.cxx index c1c2b92446a2..1f17df33dedf 100644 --- a/sw/source/core/unocore/unoflatpara.cxx +++ b/sw/source/core/unocore/unoflatpara.cxx @@ -191,7 +191,7 @@ lang::Locale SAL_CALL SwXFlatParagraph::getLanguageOfText(::sal_Int32 nPos, ::sa { SolarMutexGuard aGuard; if (!mpTxtNode) - return LanguageTag( LANGUAGE_NONE ).getLocale(); + return LanguageTag::convertToLocale( LANGUAGE_NONE ); const lang::Locale aLocale( SW_BREAKITER()->GetLocale( mpTxtNode->GetLang( static_cast<sal_uInt16>(nPos), static_cast<sal_uInt16>(nLen) ) ) ); return aLocale; @@ -204,7 +204,7 @@ lang::Locale SAL_CALL SwXFlatParagraph::getPrimaryLanguageOfText(::sal_Int32 nPo SolarMutexGuard aGuard; if (!mpTxtNode) - return LanguageTag( LANGUAGE_NONE ).getLocale(); + return LanguageTag::convertToLocale( LANGUAGE_NONE ); const lang::Locale aLocale( SW_BREAKITER()->GetLocale( mpTxtNode->GetLang( static_cast<sal_uInt16>(nPos), static_cast<sal_uInt16>(nLen) ) ) ); return aLocale; diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index cda70a19a7a9..411f5cc32947 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -638,7 +638,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException, { throw lang::IllegalArgumentException(); } - rTOXBase.SetLanguage( LanguageTag(aLocale).getLanguageType()); + rTOXBase.SetLanguage( LanguageTag::convertToLanguageType(aLocale)); } break; case WID_IDX_SORT_ALGORITHM: diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index e03ad2729fe5..f4ac2b6dbad8 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -2808,7 +2808,7 @@ sal_Bool SwUnoCursorHelper::ConvertSortProperties( lang::Locale aLocale; if (aValue >>= aLocale) { - rSortOpt.nLanguage = LanguageTag( aLocale).getLanguageType(); + rSortOpt.nLanguage = LanguageTag::convertToLanguageType( aLocale); } else { @@ -2917,7 +2917,7 @@ sal_Bool SwUnoCursorHelper::ConvertSortProperties( { rSortOpt.bIgnoreCase = !pFields[i].IsCaseSensitive; rSortOpt.nLanguage = - LanguageTag( pFields[i].CollatorLocale ).getLanguageType(); + LanguageTag::convertToLanguageType( pFields[i].CollatorLocale ); aKeys[i]->sSortType = pFields[i].CollatorAlgorithm; aKeys[i]->nColumnId = static_cast<sal_uInt16>(pFields[i].Field); diff --git a/sw/source/filter/basflt/fltini.cxx b/sw/source/filter/basflt/fltini.cxx index 6dccc831ecd5..963156e236d5 100644 --- a/sw/source/filter/basflt/fltini.cxx +++ b/sw/source/filter/basflt/fltini.cxx @@ -623,7 +623,7 @@ void SwAsciiOptions::ReadUserData( const String& rStr ) sFont = sToken; break; case 3: // Language - nLanguage = LanguageTag( sToken ).getLanguageType(); + nLanguage = LanguageTag::convertToLanguageType( sToken ); break; } } @@ -659,7 +659,7 @@ void SwAsciiOptions::WriteUserData( String& rStr ) // 4. Language if (nLanguage) { - OUString sTmp = LanguageTag( nLanguage ).getBcp47(); + OUString sTmp = LanguageTag::convertToBcp47( nLanguage ); rStr += (String)sTmp; } rStr += ','; diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index effb4a80112b..155eaa6025bc 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -2754,7 +2754,7 @@ static Writer& OutCSS1_SvxLanguage( Writer& rWrt, const SfxPoolItem& rHt ) if( LANGUAGE_DONTKNOW == eLang ) return rWrt; - String sOut = LanguageTag( eLang ).getBcp47(); + String sOut = LanguageTag::convertToBcp47( eLang ); rHTMLWrt.OutCSS1_Property( sCSS1_P_so_language, sOut ); diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx index 6423ce55a1b9..3ac6243f6ad9 100644 --- a/sw/source/filter/html/htmlcss1.cxx +++ b/sw/source/filter/html/htmlcss1.cxx @@ -1942,7 +1942,7 @@ sal_Bool SwHTMLParser::ParseStyleOptions( const String &rStyle, if( pLang && pLang->Len() ) { - LanguageType eLang = LanguageTag( *pLang ).getLanguageType(); + LanguageType eLang = LanguageTag::convertToLanguageType( *pLang ); if( LANGUAGE_DONTKNOW != eLang ) { SvxLanguageItem aLang( eLang, RES_CHRATR_LANGUAGE ); diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index de89a5926d0c..aa4a93351feb 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -987,7 +987,7 @@ void SwHTMLParser::InsertBodyOptions() } if( aLang.Len() ) { - LanguageType eLang = LanguageTag( aLang ).getLanguageType(); + LanguageType eLang = LanguageTag::convertToLanguageType( aLang ); if( LANGUAGE_DONTKNOW != eLang ) { sal_uInt16 nWhich = 0; diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index 124e79f5cf9a..5df779fb17fe 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -1180,7 +1180,7 @@ void SwHTMLWriter::OutLanguage( LanguageType nLang ) sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_lang) .append("=\""); Strm() << sOut.makeStringAndClear().getStr(); - HTMLOutFuncs::Out_String( Strm(), LanguageTag(nLang).getBcp47(), + HTMLOutFuncs::Out_String( Strm(), LanguageTag::convertToBcp47(nLang), eDestEnc, &aNonConvertableCharacters ) << '"'; } } diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index d7697ca0d749..1c0e257f35ce 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -1199,7 +1199,7 @@ void DocxAttributeOutput::StartRuby( const SwTxtNode& rNode, xub_StrLen nPos, co // lid lang::Locale aLocale( SwBreakIt::Get()->GetLocale( rNode.GetLang( nPos ) ) ); - OUString sLang( LanguageTag( aLocale).getBcp47() ); + OUString sLang( LanguageTag::convertToBcp47( aLocale) ); m_pSerializer->singleElementNS( XML_w, XML_lid, FSNS( XML_w, XML_val ), OUStringToOString( sLang, RTL_TEXTENCODING_UTF8 ).getStr( ), FSEND ); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 32dc410f9f11..ce231d65fa78 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -2424,7 +2424,7 @@ CharSet SwWW8ImplReader::GetCurrentCharSet() */ const SvxLanguageItem *pLang = (const SvxLanguageItem*)GetFmtAttr(RES_CHRATR_LANGUAGE); LanguageType eLang = pLang ? pLang->GetLanguage() : LANGUAGE_SYSTEM; - ::com::sun::star::lang::Locale aLocale(LanguageTag(eLang).getLocale()); + ::com::sun::star::lang::Locale aLocale(LanguageTag::convertToLocale(eLang)); eSrcCharSet = msfilter::util::getBestTextEncodingFromLocale(aLocale); } } diff --git a/sw/source/ui/app/appopt.cxx b/sw/source/ui/app/appopt.cxx index 4cb564cf899d..b3fb4af34387 100644 --- a/sw/source/ui/app/appopt.cxx +++ b/sw/source/ui/app/appopt.cxx @@ -154,17 +154,17 @@ SfxItemSet* SwModule::CreateItemSet( sal_uInt16 nId ) Any aLang = aLinguCfg.GetProperty(OUString("DefaultLocale")); aLang >>= aLocale; - nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag(aLocale).getLanguageType(false), LATIN); + nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType( aLocale, false), LATIN); pRet->Put(SvxLanguageItem(nLang, SID_ATTR_LANGUAGE)); aLang = aLinguCfg.GetProperty(OUString("DefaultLocale_CJK")); aLang >>= aLocale; - nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag(aLocale).getLanguageType(false), ASIAN); + nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType( aLocale, false), ASIAN); pRet->Put(SvxLanguageItem(nLang, SID_ATTR_CHAR_CJK_LANGUAGE)); aLang = aLinguCfg.GetProperty(OUString("DefaultLocale_CTL")); aLang >>= aLocale; - nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag(aLocale).getLanguageType(false), COMPLEX); + nLang = MsLangId::resolveSystemLanguageByScriptType(LanguageTag::convertToLanguageType( aLocale, false), COMPLEX); pRet->Put(SvxLanguageItem(nLang, SID_ATTR_CHAR_CTL_LANGUAGE)); } if(bTextDialog) diff --git a/sw/source/ui/app/docshini.cxx b/sw/source/ui/app/docshini.cxx index 58d77b9afbd3..5b373892e7d9 100644 --- a/sw/source/ui/app/docshini.cxx +++ b/sw/source/ui/app/docshini.cxx @@ -121,7 +121,7 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) { ForbiddenCharacters aForbidden; aAsian.GetStartEndChars( pLocales[i], aForbidden.beginLine, aForbidden.endLine); - LanguageType eLang = LanguageTag(pLocales[i]).getLanguageType(); + LanguageType eLang = LanguageTag::convertToLanguageType(pLocales[i]); pDoc->setForbiddenCharacters( eLang, aForbidden); } } diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index a237b50ab95b..d43b1328331a 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -1670,7 +1670,7 @@ void SwInsertDBColAutoPilot::Commit() if( eLang != ePrevLang ) { - sPrevLang = LanguageTag( eLang ).getBcp47(); + sPrevLang = LanguageTag::convertToBcp47( eLang ); ePrevLang = eLang; } @@ -1761,7 +1761,7 @@ void SwInsertDBColAutoPilot::Load() * case-insensitive equal language/country combos that may have * worked, for all others not. FIXME if you need to read old * data that you were never able to read before. */ - pInsDBColumn->eUsrNumFmtLng = LanguageTag( sNumberFormatLocale ).getLanguageType(); + pInsDBColumn->eUsrNumFmtLng = LanguageTag::convertToLanguageType( sNumberFormatLocale ); pInsDBColumn->nUsrNumFmt = rNFmtr.GetEntryKey( pInsDBColumn->sUsrNumFmt, pInsDBColumn->eUsrNumFmtLng ); diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx index e9cf706b5003..cab0acc72c4b 100644 --- a/sw/source/ui/index/swuiidxmrk.cxx +++ b/sw/source/ui/index/swuiidxmrk.cxx @@ -346,7 +346,7 @@ String SwIndexMarkPane::GetDefaultPhoneticReading( const String& rText ) if( !bIsPhoneticReadingEnabled ) return aEmptyStr; - return xExtendedIndexEntrySupplier->getPhoneticCandidate(rText, LanguageTag( nLangForPhoneticReading ).getLocale()); + return xExtendedIndexEntrySupplier->getPhoneticCandidate(rText, LanguageTag::convertToLocale( nLangForPhoneticReading )); } /* -------------------------------------------------- diff --git a/sw/source/ui/lingu/hhcwrp.cxx b/sw/source/ui/lingu/hhcwrp.cxx index 5867e1207bd4..faa5e662bedd 100644 --- a/sw/source/ui/lingu/hhcwrp.cxx +++ b/sw/source/ui/lingu/hhcwrp.cxx @@ -95,8 +95,8 @@ SwHHCWrapper::SwHHCWrapper( bool bIsInteractive, bool bStart, bool bOther, bool bSelection ) : editeng::HangulHanjaConversion( &pSwView->GetEditWin(), rxContext, - LanguageTag( nSourceLanguage ).getLocale(), - LanguageTag( nTargetLanguage ).getLocale(), + LanguageTag::convertToLocale( nSourceLanguage ), + LanguageTag::convertToLocale( nTargetLanguage ), pTargetFont, nConvOptions, bIsInteractive ) diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx index 43398e11e8ee..1909479b1b62 100644 --- a/sw/source/ui/lingu/olmenu.cxx +++ b/sw/source/ui/lingu/olmenu.cxx @@ -490,7 +490,7 @@ sExplanationLink( ), bGrammarResults( true ), aInfo16( SW_RES(IMG_INFO_16) ) { - nCheckedLanguage = LanguageTag( rResult.aLocale ).getLanguageType(); + nCheckedLanguage = LanguageTag::convertToLanguageType( rResult.aLocale ); nGrammarError = nErrorInResult; bool bUseImagesInMenus = Application::GetSettings().GetStyleSettings().GetUseImagesInMenus(); diff --git a/sw/source/ui/shells/annotsh.cxx b/sw/source/ui/shells/annotsh.cxx index ab95b129dbb7..f1c54f1870ca 100644 --- a/sw/source/ui/shells/annotsh.cxx +++ b/sw/source/ui/shells/annotsh.cxx @@ -1324,7 +1324,7 @@ void SwAnnotationShell::GetLinguState(SfxItemSet &rSet) // disable "Thesaurus" context menu entry if there is nothing to look up uno::Reference< linguistic2::XThesaurus > xThes( ::GetThesaurus() ); if (!bIsLookUpWord || - !xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( LanguageTag( nLang ).getLocale() )) + !xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( LanguageTag::convertToLocale( nLang ) )) rSet.DisableItem( SID_THES ); break; } @@ -1339,7 +1339,7 @@ void SwAnnotationShell::GetLinguState(SfxItemSet &rSet) rItem).GetLanguage(); uno::Reference< linguistic2::XThesaurus > xThes( ::GetThesaurus() ); if (!xThes.is() || nLang == LANGUAGE_NONE || - !xThes->hasLocale( LanguageTag( nLang ).getLocale() )) + !xThes->hasLocale( LanguageTag::convertToLocale( nLang ) )) rSet.DisableItem( SID_THESAURUS ); } break; diff --git a/sw/source/ui/shells/drwtxtex.cxx b/sw/source/ui/shells/drwtxtex.cxx index b533ea1b5fa4..547ba2e2f1fb 100644 --- a/sw/source/ui/shells/drwtxtex.cxx +++ b/sw/source/ui/shells/drwtxtex.cxx @@ -604,7 +604,7 @@ void SwDrawTextShell::GetState(SfxItemSet& rSet) // disable "Thesaurus" context menu entry if there is nothing to look up uno::Reference< linguistic2::XThesaurus > xThes( ::GetThesaurus() ); if (!bIsLookUpWord || - !xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( LanguageTag( nLang ).getLocale() )) + !xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( LanguageTag::convertToLocale( nLang ) )) rSet.DisableItem( SID_THES ); //! avoid putting the same item as SfxBoolItem at the end of this function @@ -714,7 +714,7 @@ ASK_ESCAPE: LanguageType nLang = ((const SvxLanguageItem &) rItem).GetLanguage(); uno::Reference< linguistic2::XThesaurus > xThes( ::GetThesaurus() ); - if (!xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( LanguageTag( nLang ).getLocale() )) + if (!xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( LanguageTag::convertToLocale( nLang ) )) rSet.DisableItem( SID_THESAURUS ); nSlotId = 0; } diff --git a/sw/source/ui/uiview/viewling.cxx b/sw/source/ui/uiview/viewling.cxx index 98d0dfc306f9..fc497fd71c49 100644 --- a/sw/source/ui/uiview/viewling.cxx +++ b/sw/source/ui/uiview/viewling.cxx @@ -579,7 +579,7 @@ void SwView::StartThesaurus() Reference< XThesaurus > xThes( ::GetThesaurus() ); AbstractThesaurusDialog *pDlg = NULL; - if ( !xThes.is() || !xThes->hasLocale( LanguageTag( eLang ).getLocale() ) ) + if ( !xThes.is() || !xThes->hasLocale( LanguageTag::convertToLocale( eLang ) ) ) SpellError( eLang ); else { diff --git a/sw/source/ui/uiview/viewstat.cxx b/sw/source/ui/uiview/viewstat.cxx index 21aa946afce2..91a3d4df07d3 100644 --- a/sw/source/ui/uiview/viewstat.cxx +++ b/sw/source/ui/uiview/viewstat.cxx @@ -299,7 +299,7 @@ void SwView::GetState(SfxItemSet &rSet) // language is not supported (by default it is enabled) uno::Reference< linguistic2::XThesaurus > xThes( ::GetThesaurus() ); if (!xThes.is() || nLang == LANGUAGE_NONE || - !xThes->hasLocale( LanguageTag( nLang ).getLocale() )) + !xThes->hasLocale( LanguageTag::convertToLocale( nLang ) )) rSet.DisableItem(nWhich); } } diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index beefaf1e196d..ae06e5756771 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -3329,7 +3329,7 @@ uno::Sequence< lang::Locale > SAL_CALL SwXTextDocument::getDocumentLanguages( break; if (LANGUAGE_NONE != *it) { - pLanguage[nCount] = LanguageTag( *it ).getLocale(); + pLanguage[nCount] = LanguageTag::convertToLocale( *it ); pLanguage[nCount].Language = aLangTab.GetString( *it ); nCount += 1; } diff --git a/sw/source/ui/vba/vbastyle.cxx b/sw/source/ui/vba/vbastyle.cxx index bcf6be337ed0..b96dc992028b 100644 --- a/sw/source/ui/vba/vbastyle.cxx +++ b/sw/source/ui/vba/vbastyle.cxx @@ -52,7 +52,7 @@ sal_Int32 SwVbaStyle::getLanguageID( const uno::Reference< beans::XPropertySet > { lang::Locale aLocale; xTCProps->getPropertyValue("CharLocale") >>= aLocale; - return LanguageTag( aLocale ).getLanguageType( false); + return LanguageTag::convertToLanguageType( aLocale, false); } void SwVbaStyle::setLanguageID( const uno::Reference< beans::XPropertySet >& xTCProps, sal_Int32 _languageid ) throw (uno::RuntimeException) diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx index a48e018a2e81..5adef3068dd6 100644 --- a/unotools/source/config/lingucfg.cxx +++ b/unotools/source/config/lingucfg.cxx @@ -60,7 +60,7 @@ static sal_Bool lcl_SetLocale( sal_Int16 &rLanguage, const uno::Any &rVal ) lang::Locale aNew; if (rVal >>= aNew) // conversion successful? { - sal_Int16 nNew = LanguageTag( aNew ).getLanguageType( false); + sal_Int16 nNew = LanguageTag::convertToLanguageType( aNew, false); if (nNew != rLanguage) { rLanguage = nNew; @@ -74,7 +74,7 @@ static inline const OUString lcl_LanguageToCfgLocaleStr( sal_Int16 nLanguage ) { OUString aRes; if (LANGUAGE_SYSTEM != nLanguage) - aRes = LanguageTag( nLanguage ).getBcp47(); + aRes = LanguageTag::convertToBcp47( nLanguage ); return aRes; } @@ -82,7 +82,7 @@ static sal_Int16 lcl_CfgAnyToLanguage( const uno::Any &rVal ) { OUString aTmp; rVal >>= aTmp; - return (aTmp.isEmpty()) ? LANGUAGE_SYSTEM : LanguageTag( aTmp ).getLanguageType(); + return (aTmp.isEmpty()) ? LANGUAGE_SYSTEM : LanguageTag::convertToLanguageType( aTmp ); } SvtLinguOptions::SvtLinguOptions() @@ -364,19 +364,19 @@ uno::Any SvtLinguConfigItem::GetProperty( sal_Int32 nPropertyHandle ) const } case UPH_DEFAULT_LOCALE : { - lang::Locale aLocale( LanguageTag( rOpt.nDefaultLanguage ).getLocale( false ) ); + lang::Locale aLocale( LanguageTag::convertToLocale( rOpt.nDefaultLanguage, false) ); aRes.setValue( &aLocale, ::getCppuType((lang::Locale*)0 )); break; } case UPH_DEFAULT_LOCALE_CJK : { - lang::Locale aLocale( LanguageTag( rOpt.nDefaultLanguage_CJK ).getLocale( false ) ); + lang::Locale aLocale( LanguageTag::convertToLocale( rOpt.nDefaultLanguage_CJK, false) ); aRes.setValue( &aLocale, ::getCppuType((lang::Locale*)0 )); break; } case UPH_DEFAULT_LOCALE_CTL : { - lang::Locale aLocale( LanguageTag( rOpt.nDefaultLanguage_CTL ).getLocale( false ) ); + lang::Locale aLocale( LanguageTag::convertToLocale( rOpt.nDefaultLanguage_CTL, false) ); aRes.setValue( &aLocale, ::getCppuType((lang::Locale*)0 )); break; } diff --git a/unotools/source/config/syslocaleoptions.cxx b/unotools/source/config/syslocaleoptions.cxx index 31879c400496..fbab88b34d91 100644 --- a/unotools/source/config/syslocaleoptions.cxx +++ b/unotools/source/config/syslocaleoptions.cxx @@ -676,7 +676,7 @@ void SvtSysLocaleOptions::GetCurrencyAbbrevAndLanguage( OUString& rAbbrev, { rAbbrev = rConfigString.copy( 0, nDelim ); OUString aIsoStr( rConfigString.copy( nDelim+1 ) ); - eLang = LanguageTag( aIsoStr ).getLanguageType(); + eLang = LanguageTag::convertToLanguageType( aIsoStr ); } else { @@ -690,7 +690,7 @@ void SvtSysLocaleOptions::GetCurrencyAbbrevAndLanguage( OUString& rAbbrev, OUString SvtSysLocaleOptions::CreateCurrencyConfigString( const OUString& rAbbrev, LanguageType eLang ) { - OUString aIsoStr( LanguageTag( eLang ).getBcp47() ); + OUString aIsoStr( LanguageTag::convertToBcp47( eLang ) ); if ( !aIsoStr.isEmpty() ) { OUStringBuffer aStr( rAbbrev.getLength() + 1 + aIsoStr.getLength() ); diff --git a/unotools/source/i18n/textsearch.cxx b/unotools/source/i18n/textsearch.cxx index 5e8327fdf42c..6582230e1cf2 100644 --- a/unotools/source/i18n/textsearch.cxx +++ b/unotools/source/i18n/textsearch.cxx @@ -128,7 +128,7 @@ TextSearch::TextSearch(const SearchParam & rParam, LanguageType eLang ) { if( LANGUAGE_NONE == eLang ) eLang = LANGUAGE_SYSTEM; - ::com::sun::star::lang::Locale aLocale( LanguageTag( eLang ).getLocale() ); + ::com::sun::star::lang::Locale aLocale( LanguageTag::convertToLocale( eLang ) ); Init( rParam, aLocale); } diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx index 19c9820dc354..2210ca41670a 100644 --- a/vcl/win/source/gdi/winlayout.cxx +++ b/vcl/win/source/gdi/winlayout.cxx @@ -2754,7 +2754,7 @@ GraphiteWinLayout::GraphiteWinLayout(HDC hDC, const ImplWinFontData& rWFD, ImplW mpFont = gr_make_font_with_advance_fn(static_cast<float>(-aLogFont.lfHeight), hDC, gr_fontAdvance, rWFD.GraphiteFace()); maImpl.SetFont(mpFont); - const OString aLang = OUStringToOString( LanguageTag( rWFE.maFontSelData.meLanguage ).getBcp47(), + const OString aLang = OUStringToOString( LanguageTag::convertToBcp47( rWFE.maFontSelData.meLanguage ), RTL_TEXTENCODING_ASCII_US); OString name = OUStringToOString( rWFE.maFontSelData.maTargetName, RTL_TEXTENCODING_UTF8 ); diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 70db8467a75e..632f35b73030 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -1144,7 +1144,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) case NS_ooxml::LN_CT_Language_eastAsia: //90315 case NS_ooxml::LN_CT_Language_bidi: //90316 { - lang::Locale aLocale( LanguageTag( sStringValue).getLocale()); + lang::Locale aLocale( LanguageTag::convertToLocale( sStringValue)); if (m_pImpl->GetTopContext()) m_pImpl->GetTopContext()->Insert(NS_ooxml::LN_CT_Language_val== nName ? PROP_CHAR_LOCALE : NS_ooxml::LN_CT_Language_eastAsia == nName ? PROP_CHAR_LOCALE_ASIAN : PROP_CHAR_LOCALE_COMPLEX, diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx index ea4e0cab0518..e3ca3a76430b 100644 --- a/xmloff/source/style/xmlnumfe.cxx +++ b/xmloff/source/style/xmlnumfe.cxx @@ -847,7 +847,7 @@ static OUString lcl_GetDefaultCalendar( SvNumberFormatter* pFormatter, LanguageT CalendarWrapper* pCalendar = pFormatter->GetCalendar(); if (pCalendar) { - lang::Locale aLocale( LanguageTag( nLang ).getLocale() ); + lang::Locale aLocale( LanguageTag::convertToLocale( nLang ) ); uno::Sequence<OUString> aCals = pCalendar->getAllCalendars( aLocale ); sal_Int32 nCnt = aCals.getLength(); @@ -1325,7 +1325,7 @@ void SvXMLNumFmtExport::ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt // automatic currency symbol is implemented as part of // normal text -> search for the symbol bCurrencyWritten = WriteTextWithCurrency_Impl( *pElemStr, - LanguageTag( nLang ).getLocale() ); + LanguageTag::convertToLocale( nLang ) ); bAnyContent = sal_True; } else diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx index d6902066d2b1..650541dfcf03 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx @@ -545,7 +545,7 @@ void FormattedFieldElement::endElement() sal_Int32 semi0 = sLocale.indexOf( ';' ); if (semi0 < 0) // no semi at all, try new BCP47 or just language { - locale = LanguageTag( sLocale).getLocale( false); + locale = LanguageTag::convertToLocale( sLocale, false); } else { |