diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2022-05-14 16:52:09 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2022-05-16 09:05:00 +0200 |
commit | 86039563de87149a01ffb980b5ec99074b98fd5e (patch) | |
tree | fe0de316998d7afdb69721e1912303e5b36c9f17 | |
parent | fix GETPIVOTDATA() field name lookup (diff) | |
download | core-86039563de87149a01ffb980b5ec99074b98fd5e.tar.gz core-86039563de87149a01ffb980b5ec99074b98fd5e.zip |
std::stable_sort() where libc++ debug mode breaks a unittest
Libc++ debug has a feature that randomizes equal elements during
sort, which normally wouldn't make a difference, but some tests
rely on specific order of tested data. The ones failing without
this include:
CppunitTest_sw_ooxmlexport testMsoPosition
CppunitTest_sw_xhtmlexport testTdf66305
CppunitTest_sw_ww8export testCommentExport
Change-Id: Id49846939a264150cc82091718ffe6b904d7130e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134337
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
-rw-r--r-- | svl/source/items/stylepool.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/writerhelper.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8nds.cxx | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/svl/source/items/stylepool.cxx b/svl/source/items/stylepool.cxx index b74d0cb94729..dc992a6ede72 100644 --- a/svl/source/items/stylepool.cxx +++ b/svl/source/items/stylepool.cxx @@ -261,7 +261,7 @@ namespace { // Sort the parents using their name, if they have one. if (!rParentNames.empty()) { - std::sort(maParents.begin(), maParents.end(), + std::stable_sort(maParents.begin(), maParents.end(), [&rParentNames](const SfxItemSet* pA, const SfxItemSet* pB) { OUString aA; OUString aB; diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx index 6c62af767ab0..9c3bae38f14d 100644 --- a/sw/source/filter/ww8/writerhelper.cxx +++ b/sw/source/filter/ww8/writerhelper.cxx @@ -838,7 +838,7 @@ namespace sw RedlineStack::~RedlineStack() { - std::sort(maStack.begin(), maStack.end(), CompareRedlines()); + std::stable_sort(maStack.begin(), maStack.end(), CompareRedlines()); std::for_each(maStack.begin(), maStack.end(), SetInDocAndDelete(mrDoc)); } diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 3ff1326c24a7..da9c73099dae 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -220,7 +220,7 @@ SwWW8AttrIter::SwWW8AttrIter(MSWordExportBase& rWr, const SwTextNode& rTextNd) : Get list of any graphics which may be anchored from this paragraph. */ maFlyFrames = GetFramesInNode(rWr.m_aFrames, m_rNode); - std::sort(maFlyFrames.begin(), maFlyFrames.end(), sortswflys()); + std::stable_sort(maFlyFrames.begin(), maFlyFrames.end(), sortswflys()); /* #i18480# |