summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2023-03-24 17:52:28 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2023-03-27 08:56:30 +0000
commita9ba09b66feec19206b0b7c6b70c6d905a6dbfe2 (patch)
tree629f5f473d21978aff48e934692d8151719f73f4
parent002a6fee2fbd07c3f0cd1f1ddba39c691130727e (diff)
sw: fix assert due to inconsistent ordering of MarkManager::m_vAllMarks
In function: std::pair<_FIter, _FIter> std::equal_range(_FIter, _FIter, const _Tp&, _Compare) [with _FIter = gnu_debug::_Safe_iterator<gnu_cxx:: normal_iterator<sw::mark::MarkBase**, vector<sw::mark::MarkBase*, allocator<sw::mark::MarkBase*> > >, debug::vector<sw::mark::MarkBase*>, random_access_iterator_tag>; _Tp = SwPosition; _Compare = {anonymous}::CompareIMarkStartsBefore] Error: elements in iterator range [first, last) are not partitioned by the predicate __comp and value __val. Change-Id: I2c78d64dc6e87ba1aae0dd08a0ece01b0c43e9fd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149553 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r--sw/source/core/doc/docbm.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 5dbd88064c73..e047b2d1e319 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -218,6 +218,12 @@ namespace
{
return nFirstContent < nSecondContent;
}
+ SwContentNode const*const pFirstNode(rFirstStart.nContent.GetContentNode());
+ SwContentNode const*const pSecondNode(rSecondStart.nContent.GetContentNode());
+ if ((pFirstNode != nullptr) != (pSecondNode != nullptr))
+ { // consistency with SwPosition::operator<
+ return pSecondNode != nullptr;
+ }
auto *const pCRFirst (dynamic_cast<::sw::mark::CrossRefBookmark const*>(pFirst));
auto *const pCRSecond(dynamic_cast<::sw::mark::CrossRefBookmark const*>(pSecond));
if ((pCRFirst == nullptr) == (pCRSecond == nullptr))