diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-06-05 17:36:32 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-06-06 11:54:09 +0200 |
commit | 1ae50dc4f816f37df50bfcb9d97c071fdf1e143f (patch) | |
tree | 43f9df48af4da29ffab0185ec18564b5e247cafc /cui | |
parent | 1bdc67de20cf3090f07412513dfece356024ef0b (diff) |
Sort languages in Edit Modules dialog
After commit e855481ead996a3b8270fae91bd23d6c8d75ef25, these languages
are already ordered according to css::lang::Locale sorting implemented
there; but this ordering does not follow the UI language sorting rules.
TODO: put language without country/variant before respective languages
having country/variant.
Change-Id: Ic98b50ef4a500c799110611f7c35c74b4a239ed4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152641
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/optlingu.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx index 6097f307038f..d13ca464bbe0 100644 --- a/cui/source/options/optlingu.cxx +++ b/cui/source/options/optlingu.cxx @@ -1603,11 +1603,11 @@ SvxEditModulesDlg::SvxEditModulesDlg(weld::Window* pParent, SvxLinguData_Impl& r //fill language box const auto& rLoc = rLinguData.GetAllSupportedLocales(); - for (Locale const & locale : rLoc) - { - LanguageType nLang = LanguageTag::convertToLanguageType( locale ); - m_xLanguageLB->InsertLanguage(nLang); - } + std::vector<LanguageType> aLanguages; + aLanguages.reserve(rLoc.size()); + std::transform(rLoc.begin(), rLoc.end(), std::back_inserter(aLanguages), + [](Locale const& locale) { return LanguageTag::convertToLanguageType(locale); }); + m_xLanguageLB->InsertLanguages(aLanguages); LanguageType eSysLang = MsLangId::getConfiguredSystemLanguage(); m_xLanguageLB->set_active_id( eSysLang ); if (m_xLanguageLB->get_active_id() != eSysLang) |