sc/source/core/data/documen3.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 37af3c83bda0d56cf6d0d7a58665cbcaa60a3cc1
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Fri Sep 9 22:41:32 2022 +0200
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Sat Sep 10 09:51:52 2022 +0200

    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.ext...@allotropia.de>
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

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());
         }
     }
 }

Reply via email to