svx/source/dialog/langbox.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
New commits: commit 181f4c5ac9834c15fe0acc4b6e92f064e95ab32c Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Thu Feb 8 12:34:59 2024 +0600 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Thu Feb 8 09:31:46 2024 +0100 Try harder to use strict weak ordering when sorting Special LanguageType referring to a system locale can resolve to some language tag equal to another one, but they still compared inequal in the check at the top of GenericFirst comparator, because only values of LanguageType were compared. This could lead to a failed assertion later, because both could then be ISO locales, and have no country. Change-Id: I62dda8ed6f8b1b4c7ab4957b3eecfdef602b91a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163107 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx index f83cc956961e..e8b82e3ac63c 100644 --- a/svx/source/dialog/langbox.cxx +++ b/svx/source/dialog/langbox.cxx @@ -219,8 +219,8 @@ static void SortLanguages(std::vector<weld::ComboBoxEntry>& rEntries) bool operator()(const EntryData& e1, const EntryData& e2) const { assert(e1.tag.getLanguage() == e2.tag.getLanguage()); - if (e1.entry.sId == e2.entry.sId) - return false; // shortcut + if (e1.entry.sId == e2.entry.sId || e1.tag.equals(e2.tag)) + return false; // shortcut; make sure to also compare tags, to resolve system locale // Make sure that e.g. generic 'Spanish {es}' goes before 'Spanish (Argentina)'. // We can't depend on MsLangId::getPrimaryLanguage/getSubLanguage, because e.g.