mirror of
https://github.com/storytold/gridcraft.git
synced 2026-11-16 15:23:57 +00:00
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:
2 files changed
+17
No files matched your search
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user