engine: leave a descending custom-list key as it was (#3949)

Comparing two values not in the list changed descending custom-list keys too:
they no longer tied, so a later key could not order them. Only an ascending
key sorts them now; with a descending one they tie, as before.
This commit is contained in:
Zinadin Zidan committed 2026-11-14 22:36:26 +06:00
1 parent 07fcccd855
commit de3576286e
2 files changed
+17

No files matched your search

+2
View File
@@ -135,6 +135,8 @@ fn do_sort(s: &mut Session, sheet: usize, r: RangeRef, header: bool, keys: Vec<S
(Some(_), None) => Ordering::Less,
(None, Some(_)) => Ordering::Greater,
// Values not in the list follow the listed ones in the usual order, as in Excel.
// A descending key is left as it was: they tie, so the next key decides.
(None, None) if k.desc => Ordering::Equal,
(None, None) => plain(),
}
} else {