commit 0aaa930a5c1d400e69082eb60ccac47cc88f9859
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Fri Mar 18 18:03:22 2016 +0100

    Do not assert when cursor is deeper than anchor
    
    This works around bug #9917 and might give us an occasion of obtaining a 
recipe for reproducing it.

diff --git a/src/Cursor.cpp b/src/Cursor.cpp
index 8d94ddf..26aeabf 100644
--- a/src/Cursor.cpp
+++ b/src/Cursor.cpp
@@ -1046,8 +1046,11 @@ CursorSlice Cursor::normalAnchor() const
        // LASSERT: There have been several bugs around this code, that seem
        // to involve failures to reset the anchor. We can at least not crash
        // in release mode by resetting it ourselves.
-       LASSERT(anchor_.depth() >= depth(),
-               const_cast<DocIterator &>(anchor_) = *this);
+       if (anchor_.depth() < depth()) {
+               LYXERR0("Cursor is deeper than anchor. PLEASE REPORT.\nCursor 
is"
+                       << *this);
+               const_cast<DocIterator &>(anchor_) = *this;
+       }
 
        CursorSlice normal = anchor_[depth() - 1];
        if (depth() < anchor_.depth() && top() <= normal) {

Reply via email to