sw/source/core/doc/docbm.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit a9ba09b66feec19206b0b7c6b70c6d905a6dbfe2
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Fri Mar 24 17:52:28 2023 +0100
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Mon Mar 27 08:56:30 2023 +0000

    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.st...@allotropia.de>

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))

Reply via email to