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>
This commit is contained in:
Luboš Luňák
2022-05-16 09:05:00 +02:00
parent ca8614fc44
commit 86039563de
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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));
}
+1 -1
View File
@@ -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#