diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-09-09 22:41:32 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-09-10 09:51:52 +0200 |
commit | 37af3c83bda0d56cf6d0d7a58665cbcaa60a3cc1 (patch) | |
tree | 4ae78ffc45f2fc0951b2a854640a59be8c12f7c1 /sc | |
parent | ac7c09450bfc50269c0244fdb6eb55f2829d7dbf (diff) |
Use stable_sort to sort hidden rows in sortAndRemoveDuplicates
With a randomizing debug-mode libc++, UITest_autofilter2 failed for me with
> FAIL: test_tdf117276_autofilter (tdf117276.tdf117276)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "sc/qa/uitest/autofilter2/tdf117276.py", line 78, in test_tdf117276_autofilter
> self.assertFalse(is_row_hidden(calc_doc, 21))
> AssertionError: True is not false
when _LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY_SEED is e.g. 0.
Change-Id: I3e77731e2f3a2283fcf70293fab39369f316d301
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139742
Tested-by: Jenkins
Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/documen3.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index 87f4dfec813b..c1bdd76c6780 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -89,7 +89,7 @@ void sortAndRemoveDuplicates(std::vector<ScTypedStrData>& rStrings, bool bCaseSe rStrings.erase(it, rStrings.end()); if (std::find_if(rStrings.begin(), rStrings.end(), [](ScTypedStrData& rString) { return rString.IsHiddenByFilter(); }) != rStrings.end()) { - std::sort(rStrings.begin(), rStrings.end(), ScTypedStrData::LessHiddenRows()); + std::stable_sort(rStrings.begin(), rStrings.end(), ScTypedStrData::LessHiddenRows()); } } else @@ -100,7 +100,7 @@ void sortAndRemoveDuplicates(std::vector<ScTypedStrData>& rStrings, bool bCaseSe rStrings.erase(it, rStrings.end()); if (std::find_if(rStrings.begin(), rStrings.end(), [](ScTypedStrData& rString) { return rString.IsHiddenByFilter(); }) != rStrings.end()) { - std::sort(rStrings.begin(), rStrings.end(), ScTypedStrData::LessHiddenRows()); + std::stable_sort(rStrings.begin(), rStrings.end(), ScTypedStrData::LessHiddenRows()); } } } |