diff options
Diffstat (limited to 'sw/source/ui')
-rw-r--r-- | sw/source/ui/app/docshini.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/dbui/dbinsdlg.cxx | 13 | ||||
-rw-r--r-- | sw/source/ui/fldui/fldmgr.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/fldui/inpdlg.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/index/cnttab.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/index/swuiidxmrk.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/lingu/hhcwrp.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/lingu/olmenu.cxx | 9 | ||||
-rw-r--r-- | sw/source/ui/misc/srtdlg.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/shells/annotsh.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/shells/drwtxtex.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/shells/textsh1.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/uiview/srcview.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/uiview/view2.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/uiview/viewling.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/uiview/viewsrch.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/uiview/viewstat.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/utlui/numfmtlb.cxx | 2 |
18 files changed, 36 insertions, 37 deletions
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) { |