mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
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.
This commit is contained in:
parent
9955fbbf2c
commit
0aaa930a5c
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user