diff options
author | Eike Rathke <erack@redhat.com> | 2012-11-24 18:54:09 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2012-11-24 18:56:43 +0100 |
commit | 41956321ceefb5836feb2c119b66de7bb557740f (patch) | |
tree | e756d740615881ceeea816e7ef15096f91d7cc1e /sw | |
parent | 6395c843710b59e391f10f3532442ae11fe64357 (diff) |
get rid of Svx...Locale...() double conversion nonsense
Change-Id: I21d14ff6087d1adb0ce769f2e8f8060a005250cc
Diffstat (limited to 'sw')
35 files changed, 66 insertions, 67 deletions
diff --git a/sw/source/core/bastyp/breakit.cxx b/sw/source/core/bastyp/breakit.cxx index 643ec11c6b5b..f56cd5d84f17 100644 --- a/sw/source/core/bastyp/breakit.cxx +++ b/sw/source/core/bastyp/breakit.cxx @@ -84,7 +84,7 @@ void SwBreakIt::_GetLocale( const LanguageType aLang ) { aLast = aLang; delete m_pLocale; - m_pLocale = new lang::Locale( SvxCreateLocale( aLast ) ); + m_pLocale = new lang::Locale( LanguageTag( aLast ).getLocale() ); } void SwBreakIt::_GetForbidden( const LanguageType aLang ) diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx index 27e664249bd2..d292cd5374d6 100644 --- a/sw/source/core/bastyp/calc.cxx +++ b/sw/source/core/bastyp/calc.cxx @@ -254,10 +254,10 @@ SwCalc::SwCalc( SwDoc& rD ) memset( VarTable, 0, sizeof(VarTable) ); LanguageType eLang = GetDocAppScriptLang( rDoc ); - if( eLang != SvxLocaleToLanguage( pLclData->getLanguageTag().getLocale() ) || - eLang != SvxLocaleToLanguage( pCharClass->getLanguageTag().getLocale() ) ) + if( eLang != pLclData->getLanguageTag().getLanguageType() || + eLang != pCharClass->getLanguageTag().getLanguageType() ) { - LanguageTag aLanguageTag( SvxCreateLocale( eLang )); + LanguageTag aLanguageTag( eLang ); pCharClass = new CharClass( ::comphelper::getProcessComponentContext(), aLanguageTag ); pLclData = new LocaleDataWrapper( aLanguageTag ); } @@ -560,7 +560,7 @@ SwCalcExp* SwCalc::VarLook( const String& rStr, sal_uInt16 ins ) rtl::OUString sResult; double nNumber = DBL_MAX; - long nLang = SvxLocaleToLanguage( pLclData->getLanguageTag().getLocale() ); + long nLang = pLclData->getLanguageTag().getLanguageType(); if(pMgr->GetColumnCnt( sSourceName, sTableName, sColumnName, nTmpRec, nLang, sResult, &nNumber )) { @@ -1538,10 +1538,9 @@ bool SwCalc::Str2Double( const String& rCommand, xub_StrLen& rCommandPos, if( pDoc ) { LanguageType eLang = GetDocAppScriptLang( *pDoc ); - if (eLang != - SvxLocaleToLanguage(aSysLocale.GetLanguageTag().getLocale())) + if (eLang != aSysLocale.GetLanguageTag().getLanguageType()) { - pLclD.reset( new LocaleDataWrapper( LanguageTag( SvxCreateLocale( eLang )) ) ); + pLclD.reset( new LocaleDataWrapper( LanguageTag( eLang )) ); } } diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx index 3f67271694ca..dcbf6a7ff135 100644 --- a/sw/source/core/bastyp/init.cxx +++ b/sw/source/core/bastyp/init.cxx @@ -819,7 +819,7 @@ void SwCalendarWrapper::LoadDefaultCalendar( sal_uInt16 eLang ) { sUniqueId.Erase(); if( eLang != nLang ) - loadDefaultCalendar( SvxCreateLocale( nLang = eLang )); + loadDefaultCalendar( LanguageTag( nLang = eLang ).getLocale()); } LanguageType GetAppLanguage() diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx index 6932f5b13288..dd4bf7952725 100644 --- a/sw/source/core/doc/docsort.cxx +++ b/sw/source/core/doc/docsort.cxx @@ -93,7 +93,7 @@ void SwSortElement::Init( SwDoc* pD, const SwSortOptions& rOpt, nLang = (LanguageType)GetAppLanguage(); break; } - pLocale = new lang::Locale( SvxCreateLocale( nLang ) ); + pLocale = new lang::Locale( LanguageTag( nLang ).getLocale() ); pSortCollator = new CollatorWrapper( ::comphelper::getProcessServiceFactory() ); diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index a1ed01e0b113..9b06d240140d 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -274,7 +274,7 @@ SwTxtFrm* SwAutoFormat::GetFrm( const SwTxtNode& rTxtNd ) const void SwAutoFormat::_GetCharClass( LanguageType eLang ) { delete pCharClass; - pCharClass = new CharClass( LanguageTag( SvxCreateLocale( eLang ))); + pCharClass = new CharClass( LanguageTag( eLang )); eCharClassLang = eLang; } diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx index faae4a342c92..0f10f11e15b1 100644 --- a/sw/source/core/edit/edtox.cxx +++ b/sw/source/core/edit/edtox.cxx @@ -374,7 +374,7 @@ void SwEditShell::ApplyAutoMark() SearchOptions aSearchOpt( SearchAlgorithms_ABSOLUTE, nSrchFlags, sEmpty, sEmpty, - SvxCreateLocale( LANGUAGE_SYSTEM ), + LanguageTag( LANGUAGE_SYSTEM ).getLocale(), nLEV_Other, nLEV_Longer, nLEV_Shorter, nTransliterationFlags ); diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx index ff618c819bc1..0e31c09b561c 100644 --- a/sw/source/core/fields/authfld.cxx +++ b/sw/source/core/fields/authfld.cxx @@ -397,7 +397,7 @@ bool SwAuthorityFieldType::QueryValue( Any& rVal, sal_uInt16 nWhichId ) const break; case FIELD_PROP_LOCALE: - rVal <<= SvxCreateLocale(GetLanguage()); + rVal <<= LanguageTag(GetLanguage()).getLocale(); break; case FIELD_PROP_PROP_SEQ: @@ -457,7 +457,7 @@ bool SwAuthorityFieldType::PutValue( const Any& rAny, sal_uInt16 nWhichId ) { com::sun::star::lang::Locale aLocale; if( 0 != (bRet = rAny >>= aLocale )) - SetLanguage( SvxLocaleToLanguage( aLocale )); + SetLanguage( LanguageTag( aLocale ).getLanguageType()); } break; diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index d434a7a2f041..7047d153aa8b 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -893,9 +893,9 @@ static void lcl_GetLocalDataWrapper( sal_uLong nLang, SvtSysLocale aLocale; *ppAppLocalData = &aLocale.GetLocaleData(); *ppLocalData = *ppAppLocalData; - if( nLang != SvxLocaleToLanguage( (*ppLocalData)->getLanguageTag().getLocale() ) ) + if( nLang != (*ppLocalData)->getLanguageTag().getLanguageType() ) *ppLocalData = new LocaleDataWrapper( - LanguageTag( SvxCreateLocale( static_cast<LanguageType>(nLang) )) ); + LanguageTag( static_cast<LanguageType>(nLang) )); } String SwDocInfoFieldType::Expand( sal_uInt16 nSub, sal_uInt32 nFormat, diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx index eb491ec1fb21..a79e4edf4c56 100644 --- a/sw/source/core/fields/expfld.cxx +++ b/sw/source/core/fields/expfld.cxx @@ -927,7 +927,8 @@ xub_StrLen SwGetExpField::GetReferenceTextPos( const SwFmtFld& rFmt, SwDoc& rDoc { LanguageType eLang = ((SvxLanguageItem&)aSet.Get( GetWhichOfScript( RES_CHRATR_LANGUAGE, nSrcpt )) ).GetLanguage(); - CharClass aCC( LanguageTag( SvxCreateLocale( eLang ))); + LanguageTag aLanguageTag( eLang); + CharClass aCC( aLanguageTag); sal_Unicode c0 = sNodeText.GetChar(0); sal_Bool bIsAlphaNum = aCC.isAlphaNumeric( sNodeText, 0 ); if( !bIsAlphaNum || diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx index be7934f0cb3a..b8cafaa6447d 100644 --- a/sw/source/core/fields/fldbas.cxx +++ b/sw/source/core/fields/fldbas.cxx @@ -597,7 +597,7 @@ SwFieldType* SwValueField::ChgTyp( SwFieldType* pNewType ) sal_uInt32 SwValueField::GetSystemFormat(SvNumberFormatter* pFormatter, sal_uInt32 nFmt) { const SvNumberformat* pEntry = pFormatter->GetEntry(nFmt); - sal_uInt16 nLng = SvxLocaleToLanguage( SvtSysLocale().GetLanguageTag().getLocale() ); + sal_uInt16 nLng = SvtSysLocale().GetLanguageTag().getLanguageType(); if (pEntry && nLng != pEntry->GetLanguage()) { diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx index 4d68397ba7d0..77d38f11c9f8 100644 --- a/sw/source/core/fields/reffld.cxx +++ b/sw/source/core/fields/reffld.cxx @@ -470,7 +470,8 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr ) if( !pFldTxtAttr || !pFldTxtAttr->GetpTxtNode() ) break; - LocaleDataWrapper aLocaleData( LanguageTag( SvxCreateLocale( GetLanguage() )) ); + LanguageTag aLanguageTag( GetLanguage()); + LocaleDataWrapper aLocaleData( aLanguageTag ); // erstmal ein "Kurz" - Test - falls beide im selben // Node stehen! diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx index 0e2cb2ab3203..5ae086531b3f 100644 --- a/sw/source/core/tox/txmsrt.cxx +++ b/sw/source/core/tox/txmsrt.cxx @@ -85,7 +85,7 @@ void SwTOXInternational::Init() { pIndexWrapper = new IndexEntrySupplierWrapper(); - const lang::Locale aLcl( SvxCreateLocale( eLang ) ); + const lang::Locale aLcl( LanguageTag( eLang ).getLocale() ); pIndexWrapper->SetLocale( aLcl ); if(!sSortAlgorithm.Len()) diff --git a/sw/source/core/unocore/unoflatpara.cxx b/sw/source/core/unocore/unoflatpara.cxx index 1652f9c48d54..2ae7d5efa0ee 100644 --- a/sw/source/core/unocore/unoflatpara.cxx +++ b/sw/source/core/unocore/unoflatpara.cxx @@ -179,7 +179,7 @@ lang::Locale SAL_CALL SwXFlatParagraph::getLanguageOfText(::sal_Int32 nPos, ::sa { SolarMutexGuard aGuard; if (!mpTxtNode) - return SvxCreateLocale( LANGUAGE_NONE ); + return LanguageTag( LANGUAGE_NONE ).getLocale(); const lang::Locale aLocale( SW_BREAKITER()->GetLocale( mpTxtNode->GetLang( static_cast<sal_uInt16>(nPos), static_cast<sal_uInt16>(nLen) ) ) ); return aLocale; @@ -192,7 +192,7 @@ lang::Locale SAL_CALL SwXFlatParagraph::getPrimaryLanguageOfText(::sal_Int32 nPo SolarMutexGuard aGuard; if (!mpTxtNode) - return SvxCreateLocale( LANGUAGE_NONE ); + return LanguageTag( LANGUAGE_NONE ).getLocale(); 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 d15b5cfc4a9e..7ef8e821c5c0 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -654,7 +654,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException, { throw lang::IllegalArgumentException(); } - rTOXBase.SetLanguage(SvxLocaleToLanguage(aLocale)); + rTOXBase.SetLanguage( LanguageTag(aLocale).getLanguageType()); } break; case WID_IDX_SORT_ALGORITHM: @@ -970,7 +970,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, } break; case WID_IDX_LOCALE: - aRet <<= SvxCreateLocale(pTOXBase->GetLanguage()); + aRet <<= LanguageTag(pTOXBase->GetLanguage()).getLocale(); break; case WID_IDX_SORT_ALGORITHM: aRet <<= OUString(pTOXBase->GetSortAlgorithm()); diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index 5d8dc5d347ae..aea55c81b5aa 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -2518,7 +2518,7 @@ SwUnoCursorHelper::CreateSortDescriptor(const bool bFromTable) uno::Sequence< table::TableSortField > aFields(3); table::TableSortField* pFields = aFields.getArray(); - lang::Locale aLang( SvxCreateLocale( LANGUAGE_SYSTEM ) ); + lang::Locale aLang( LanguageTag( LANGUAGE_SYSTEM).getLocale()); // get collator algorithm to be used for the locale uno::Sequence< OUString > aSeq( GetAppCollator().listCollatorAlgorithms( aLang ) ); @@ -2664,7 +2664,7 @@ sal_Bool SwUnoCursorHelper::ConvertSortProperties( lang::Locale aLocale; if (aValue >>= aLocale) { - rSortOpt.nLanguage = SvxLocaleToLanguage( aLocale ); + rSortOpt.nLanguage = LanguageTag( aLocale).getLanguageType(); } else { @@ -2773,7 +2773,7 @@ sal_Bool SwUnoCursorHelper::ConvertSortProperties( { rSortOpt.bIgnoreCase = !pFields[i].IsCaseSensitive; rSortOpt.nLanguage = - SvxLocaleToLanguage( pFields[i].CollatorLocale ); + LanguageTag( pFields[i].CollatorLocale ).getLanguageType(); aKeys[i]->sSortType = pFields[i].CollatorAlgorithm; aKeys[i]->nColumnId = static_cast<sal_uInt16>(pFields[i].Field); diff --git a/sw/source/core/unocore/unosrch.cxx b/sw/source/core/unocore/unosrch.cxx index 05b52397f19c..a738f4902b6a 100644 --- a/sw/source/core/unocore/unosrch.cxx +++ b/sw/source/core/unocore/unosrch.cxx @@ -730,7 +730,7 @@ void SwXTextSearch::FillSearchOptions( util::SearchOptions& rSearchOpt ) const else rSearchOpt.algorithmType = util::SearchAlgorithms_ABSOLUTE; - rSearchOpt.Locale = SvxCreateLocale( GetAppLanguage() ); + rSearchOpt.Locale = LanguageTag( GetAppLanguage() ).getLocale(); rSearchOpt.searchString = sSearchText; rSearchOpt.replaceString = sReplaceText; diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index c00338e81720..e48f7acfb545 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -5588,8 +5588,7 @@ WW8Fib::WW8Fib(sal_uInt8 nVer) else lidFE = lid; - Locale aTempLocale; - LanguageTag aLanguageTag( SvxLanguageToLocale( aTempLocale, lid )); + LanguageTag aLanguageTag( lid ); LocaleDataWrapper aLocaleWrapper( aLanguageTag ); nNumDecimalSep = aLocaleWrapper.getNumDecimalSep()[0]; } diff --git a/sw/source/ui/app/docshini.cxx b/sw/source/ui/app/docshini.cxx index b92062a343fd..fec131228900 100644 --- a/sw/source/ui/app/docshini.cxx +++ b/sw/source/ui/app/docshini.cxx @@ -141,7 +141,7 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) { ForbiddenCharacters aForbidden; aAsian.GetStartEndChars( pLocales[i], aForbidden.beginLine, aForbidden.endLine); - LanguageType eLang = SvxLocaleToLanguage(pLocales[i]); + LanguageType eLang = LanguageTag(pLocales[i]).getLanguageType(); pDoc->setForbiddenCharacters( eLang, aForbidden); } } diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index 713b587378f9..6b6511c293d3 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -256,7 +256,6 @@ SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView, if(xColSupp.is()) { SwWrtShell& rSh = pView->GetWrtShell(); - lang::Locale aDocLocale( SvxCreateLocale( rSh.GetCurLang() )); SvNumberFormatter* pNumFmtr = rSh.GetNumberFormatter(); SvNumberFormatsSupplierObj* pNumFmt = new SvNumberFormatsSupplierObj( pNumFmtr ); Reference< util::XNumberFormatsSupplier > xDocNumFmtsSupplier = pNumFmt; @@ -341,7 +340,7 @@ SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView, else { pNew->nDBNumFmt = SwNewDBMgr::GetDbtoolsClient().getDefaultNumberFormat(xCol, - xDocNumberFormatTypes, aDocLocale); + xDocNumberFormatTypes, LanguageTag( rSh.GetCurLang() ).getLocale()); } } @@ -1247,7 +1246,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, } } } - aDBFormatData.aLocale = SvxCreateLocale( rSh.GetCurLang() ); + aDBFormatData.aLocale = LanguageTag( rSh.GetCurLang() ).getLocale(); SwDBNextSetField aNxtDBFld( (SwDBNextSetFieldType*)rSh. GetFldType( 0, RES_DBNEXTSETFLD ), rtl::OUString("1"), aEmptyStr, aDBData ); @@ -1679,8 +1678,10 @@ void SwInsertDBColAutoPilot::Commit() if( eLang != ePrevLang ) { - lang::Locale aLocale; - aLocale = SvxLanguageToLocale( aLocale, eLang ); + /* FIXME-BCP47: handle language tags! */ + lang::Locale aLocale( LanguageTag( eLang ).getLocale()); + /* umm.. what's this string anyway, "Country-Language" instead of + * "Language-Country" ??? */ (( sPrevLang = aLocale.Country ) += rtl::OUString( '-' )) += aLocale.Language; ePrevLang = eLang; } @@ -1767,7 +1768,7 @@ void SwInsertDBColAutoPilot::Load() lang::Locale aLocale; aLocale.Language = sNumberFormatLocale.copy(0, 2); aLocale.Country = sNumberFormatLocale.copy(3, 2); - pInsDBColumn->eUsrNumFmtLng = SvxLocaleToLanguage( aLocale ); + pInsDBColumn->eUsrNumFmtLng = LanguageTag( aLocale ).getLanguageType(); pInsDBColumn->nUsrNumFmt = rNFmtr.GetEntryKey( pInsDBColumn->sUsrNumFmt, pInsDBColumn->eUsrNumFmtLng ); diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx index e5ad5db5eb60..6f226ad3d484 100644 --- a/sw/source/ui/fldui/fldmgr.cxx +++ b/sw/source/ui/fldui/fldmgr.cxx @@ -1605,7 +1605,7 @@ sal_uInt16 SwFldMgr::GetCurrLanguage() const SwWrtShell* pSh = pWrtShell ? pWrtShell : ::lcl_GetShell(); if( pSh ) return pSh->GetCurLang(); - return SvxLocaleToLanguage( SvtSysLocale().GetLanguageTag().getLocale() ); + return SvtSysLocale().GetLanguageTag().getLanguageType(); } void SwFieldType::_GetFldName() diff --git a/sw/source/ui/fldui/inpdlg.cxx b/sw/source/ui/fldui/inpdlg.cxx index e71b64621847..2a6f26fdbba4 100644 --- a/sw/source/ui/fldui/inpdlg.cxx +++ b/sw/source/ui/fldui/inpdlg.cxx @@ -111,7 +111,7 @@ SwFldInputDlg::SwFldInputDlg( Window *pParent, SwWrtShell &rS, pSetFld = (SwSetExpField*)pField; String sFormula(pSetFld->GetFormula()); //values are formatted - formulas are not - CharClass aCC( LanguageTag( SvxCreateLocale( pSetFld->GetLanguage() ))); + CharClass aCC( LanguageTag( pSetFld->GetLanguage() )); if( aCC.isNumeric( sFormula )) { aStr = pSetFld->ExpandField(true); diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index cb73fd4b5b1c..c7cd626e9acd 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -1502,7 +1502,7 @@ IMPL_LINK_NOARG(SwTOXSelectTabPage, RadioButtonHdl) IMPL_LINK(SwTOXSelectTabPage, LanguageHdl, ListBox*, pBox) { - lang::Locale aLcl( SvxCreateLocale( aLanguageLB.GetSelectLanguage() ) ); + lang::Locale aLcl( LanguageTag( aLanguageLB.GetSelectLanguage() ).getLocale() ); Sequence< OUString > aSeq = pIndexEntryWrapper->GetAlgorithmList( aLcl ); if( !pIndexRes ) diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx index b754eac9d5d4..22b186108a77 100644 --- a/sw/source/ui/index/swuiidxmrk.cxx +++ b/sw/source/ui/index/swuiidxmrk.cxx @@ -358,8 +358,7 @@ String SwIndexMarkPane::GetDefaultPhoneticReading( const String& rText ) if( !bIsPhoneticReadingEnabled ) return aEmptyStr; - lang::Locale aLocale( SvxCreateLocale( LanguageType( nLangForPhoneticReading ) ) ); - return xExtendedIndexEntrySupplier->getPhoneticCandidate(rText, aLocale); + return xExtendedIndexEntrySupplier->getPhoneticCandidate(rText, LanguageTag( nLangForPhoneticReading ).getLocale()); } /* -------------------------------------------------- @@ -451,7 +450,7 @@ static void lcl_SelectSameStrings(SwWrtShell& rSh, sal_Bool bWordOnly, sal_Bool SearchAlgorithms_ABSOLUTE, ( bWordOnly ? SearchFlags::NORM_WORD_ONLY : 0 ), rSh.GetSelTxt(), OUString(), - SvxCreateLocale( GetAppLanguage() ), + LanguageTag( GetAppLanguage() ).getLocale(), 0, 0, 0, (bCaseSensitive ? 0 diff --git a/sw/source/ui/lingu/hhcwrp.cxx b/sw/source/ui/lingu/hhcwrp.cxx index 7592c1612b73..53f653ed3b19 100644 --- a/sw/source/ui/lingu/hhcwrp.cxx +++ b/sw/source/ui/lingu/hhcwrp.cxx @@ -107,8 +107,8 @@ SwHHCWrapper::SwHHCWrapper( sal_Bool bIsInteractive, sal_Bool bStart, sal_Bool bOther, sal_Bool bSelection ) : editeng::HangulHanjaConversion( &pSwView->GetEditWin(), rxContext, - SvxCreateLocale( nSourceLanguage ), - SvxCreateLocale( nTargetLanguage ), + LanguageTag( nSourceLanguage ).getLocale(), + LanguageTag( nTargetLanguage ).getLocale(), pTargetFont, nConvOptions, bIsInteractive ), diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx index 9bc947ef4569..f5d24ca78dd5 100644 --- a/sw/source/ui/lingu/olmenu.cxx +++ b/sw/source/ui/lingu/olmenu.cxx @@ -122,9 +122,10 @@ static LanguageType lcl_CheckLanguage( // if the result from language guessing does not provide a 'Country' part // try to get it by looking up the locale setting of the office. + /* FIXME-BCP47: handle language tags */ if (aLocale.Country.isEmpty()) { - lang::Locale aTmpLocale = SvxCreateLocale( nTmpLang ); + lang::Locale aTmpLocale = LanguageTag( nTmpLang ).getLocale(); if (aTmpLocale.Language == aLocale.Language) nLang = nTmpLang; } @@ -384,7 +385,7 @@ SwSpellPopup::SwSpellPopup( nCheckedLanguage = LANGUAGE_NONE; if (xSpellAlt.is()) { - nCheckedLanguage = SvxLocaleToLanguage( xSpellAlt->getLocale() ); + nCheckedLanguage = LanguageTag( xSpellAlt->getLocale() ).getLanguageType(); aSuggestions = xSpellAlt->getAlternatives(); } sal_Int16 nStringCount = static_cast< sal_Int16 >( aSuggestions.getLength() ); @@ -479,7 +480,7 @@ SwSpellPopup::SwSpellPopup( continue; uno::Reference< frame::XStorable > xStor( xDicTmp, uno::UNO_QUERY ); - LanguageType nActLanguage = SvxLocaleToLanguage( xDicTmp->getLocale() ); + LanguageType nActLanguage = LanguageTag( xDicTmp->getLocale() ).getLanguageType(); if( xDicTmp->isActive() && xDicTmp->getDictionaryType() != linguistic2::DictionaryType_NEGATIVE && (nCheckedLanguage == nActLanguage || LANGUAGE_NONE == nActLanguage ) @@ -574,7 +575,7 @@ sExplanationLink( ), bGrammarResults( true ), aInfo16( SW_RES(IMG_INFO_16) ) { - nCheckedLanguage = SvxLocaleToLanguage( rResult.aLocale ); + nCheckedLanguage = LanguageTag( rResult.aLocale ).getLanguageType(); nGrammarError = nErrorInResult; bool bUseImagesInMenus = Application::GetSettings().GetStyleSettings().GetUseImagesInMenus(); diff --git a/sw/source/ui/misc/srtdlg.cxx b/sw/source/ui/misc/srtdlg.cxx index e73dcff83c3a..92b5acb99833 100644 --- a/sw/source/ui/misc/srtdlg.cxx +++ b/sw/source/ui/misc/srtdlg.cxx @@ -438,9 +438,8 @@ IMPL_LINK( SwSortDlg, CheckHdl, CheckBox *, pCheck ) IMPL_LINK( SwSortDlg, LanguageHdl, ListBox*, pLBox ) { - lang::Locale aLcl( SvxCreateLocale( m_pLangLB->GetSelectLanguage() ) ); - Sequence < OUString > aSeq( - GetAppCollator().listCollatorAlgorithms( aLcl )); + Sequence < OUString > aSeq( GetAppCollator().listCollatorAlgorithms( + LanguageTag( m_pLangLB->GetSelectLanguage()).getLocale() )); if( !pColRes ) pColRes = new CollatorResource(); diff --git a/sw/source/ui/shells/annotsh.cxx b/sw/source/ui/shells/annotsh.cxx index 5e56906a7160..74d3c0b6e2c5 100644 --- a/sw/source/ui/shells/annotsh.cxx +++ b/sw/source/ui/shells/annotsh.cxx @@ -1239,9 +1239,8 @@ void SwAnnotationShell::GetLinguState(SfxItemSet &rSet) // disable "Thesaurus" context menu entry if there is nothing to look up uno::Reference< linguistic2::XThesaurus > xThes( ::GetThesaurus() ); - lang::Locale aLocale( SvxCreateLocale( nLang ) ); if (!bIsLookUpWord || - !xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( aLocale )) + !xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( LanguageTag( nLang ).getLocale() )) rSet.DisableItem( SID_THES ); break; } @@ -1256,7 +1255,7 @@ void SwAnnotationShell::GetLinguState(SfxItemSet &rSet) rItem).GetLanguage(); uno::Reference< linguistic2::XThesaurus > xThes( ::GetThesaurus() ); if (!xThes.is() || nLang == LANGUAGE_NONE || - !xThes->hasLocale( SvxCreateLocale( nLang ) )) + !xThes->hasLocale( LanguageTag( nLang ).getLocale() )) rSet.DisableItem( SID_THESAURUS ); } break; diff --git a/sw/source/ui/shells/drwtxtex.cxx b/sw/source/ui/shells/drwtxtex.cxx index 37e0f49fbfac..3c6647a7626e 100644 --- a/sw/source/ui/shells/drwtxtex.cxx +++ b/sw/source/ui/shells/drwtxtex.cxx @@ -571,9 +571,8 @@ void SwDrawTextShell::GetState(SfxItemSet& rSet) // disable "Thesaurus" context menu entry if there is nothing to look up uno::Reference< linguistic2::XThesaurus > xThes( ::GetThesaurus() ); - lang::Locale aLocale( SvxCreateLocale( nLang ) ); if (!bIsLookUpWord || - !xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( aLocale )) + !xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( LanguageTag( nLang ).getLocale() )) rSet.DisableItem( SID_THES ); //! avoid puting the same item as SfxBoolItem at the end of this function @@ -641,7 +640,7 @@ ASK_ESCAPE: LanguageType nLang = ((const SvxLanguageItem &) rItem).GetLanguage(); uno::Reference< linguistic2::XThesaurus > xThes( ::GetThesaurus() ); - if (!xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( SvxCreateLocale( nLang ) )) + if (!xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( LanguageTag( nLang ).getLocale() )) rSet.DisableItem( SID_THESAURUS ); nSlotId = 0; } diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx index 1a6f28d07daf..e2faab997e8b 100644 --- a/sw/source/ui/shells/textsh1.cxx +++ b/sw/source/ui/shells/textsh1.cxx @@ -1364,8 +1364,9 @@ void SwTextShell::GetState( SfxItemSet &rSet ) aText = rSh.HasSelection()? rSh.GetSelTxt() : rSh.GetCurWord(); LanguageType nLang = rSh.GetCurLang(); - lang::Locale aLocale = SvxCreateLocale( nLang ); - String aLangText( LanguageTag( nLang ).getBcp47() ); + LanguageTag aLanguageTag( nLang); + lang::Locale aLocale( aLanguageTag.getLocale()); + String aLangText( aLanguageTag.getBcp47() ); // set word and locale to look up as status value String aStatusVal( aText ); diff --git a/sw/source/ui/uiview/srcview.cxx b/sw/source/ui/uiview/srcview.cxx index 9f0e4e61ba3b..ff7d51da0cdc 100644 --- a/sw/source/ui/uiview/srcview.cxx +++ b/sw/source/ui/uiview/srcview.cxx @@ -585,8 +585,8 @@ sal_uInt16 SwSrcView::StartSearchAndReplace(const SvxSearchItem& rSearchItem, } util::SearchOptions aSearchOpt( rSearchItem.GetSearchOptions() ); - aSearchOpt.Locale = SvxCreateLocale( - static_cast< LanguageType >( GetAppLanguage() ) ); + aSearchOpt.Locale = LanguageTag( + static_cast< LanguageType >( GetAppLanguage() ) ).getLocale(); sal_uInt16 nFound; sal_Bool bAll = sal_False; diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx index 225d63d31a11..88cade72cf52 100644 --- a/sw/source/ui/uiview/view2.cxx +++ b/sw/source/ui/uiview/view2.cxx @@ -1854,7 +1854,7 @@ bool SwView::JumpToSwMark( const String& rMark ) SearchOptions aSearchOpt( SearchAlgorithms_ABSOLUTE, 0, sName, rtl::OUString(), - SvxCreateLocale( LANGUAGE_SYSTEM ), + LanguageTag( LANGUAGE_SYSTEM ).getLocale(), 0,0,0, TransliterationModules_IGNORE_CASE ); diff --git a/sw/source/ui/uiview/viewling.cxx b/sw/source/ui/uiview/viewling.cxx index 466fe5da8c4f..b8f9b7b00111 100644 --- a/sw/source/ui/uiview/viewling.cxx +++ b/sw/source/ui/uiview/viewling.cxx @@ -593,7 +593,7 @@ void SwView::StartThesaurus() Reference< XThesaurus > xThes( ::GetThesaurus() ); AbstractThesaurusDialog *pDlg = NULL; - if ( !xThes.is() || !xThes->hasLocale( SvxCreateLocale( eLang ) ) ) + if ( !xThes.is() || !xThes->hasLocale( LanguageTag( eLang ).getLocale() ) ) SpellError( eLang ); else { diff --git a/sw/source/ui/uiview/viewsrch.cxx b/sw/source/ui/uiview/viewsrch.cxx index 3dfbd450c838..37d9757bee8a 100644 --- a/sw/source/ui/uiview/viewsrch.cxx +++ b/sw/source/ui/uiview/viewsrch.cxx @@ -731,7 +731,7 @@ sal_uLong SwView::FUNC_Search( const SwSearchOptions& rOptions ) // build SearchOptions to be used // SearchOptions aSearchOpt( pSrchItem->GetSearchOptions() ); - aSearchOpt.Locale = SvxCreateLocale( (sal_uInt16)GetAppLanguage() ); + aSearchOpt.Locale = LanguageTag( (sal_uInt16)GetAppLanguage() ).getLocale(); if( !bDoReplace ) aSearchOpt.replaceString = aEmptyStr; diff --git a/sw/source/ui/uiview/viewstat.cxx b/sw/source/ui/uiview/viewstat.cxx index 3aee693a3434..cfa97d377cbf 100644 --- a/sw/source/ui/uiview/viewstat.cxx +++ b/sw/source/ui/uiview/viewstat.cxx @@ -293,7 +293,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( SvxCreateLocale( nLang ) )) + !xThes->hasLocale( LanguageTag( nLang ).getLocale() )) rSet.DisableItem(nWhich); } } diff --git a/sw/source/ui/utlui/numfmtlb.cxx b/sw/source/ui/utlui/numfmtlb.cxx index 430ab33d66a1..a04a8a05ed90 100644 --- a/sw/source/ui/utlui/numfmtlb.cxx +++ b/sw/source/ui/utlui/numfmtlb.cxx @@ -103,7 +103,7 @@ void NumFormatListBox::Init(short nFormatType, sal_Bool bUsrFmts) if (pView) eCurLanguage = pView->GetWrtShell().GetCurLang(); else - eCurLanguage = SvxLocaleToLanguage( SvtSysLocale().GetLanguageTag().getLocale() ); + eCurLanguage = SvtSysLocale().GetLanguageTag().getLanguageType(); if (bUsrFmts == sal_False) { |