From: Vincent van Ravesteijn Date: Wed, 13 Jan 2010 18:57:42 +0000 (+0000) Subject: Fix bug #6448: Crash with invalid anchor. X-Git-Tag: 2.0.0~4385 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=b9d5184979fc68fba48762f11090de054f23cb0f;p=features.git Fix bug #6448: Crash with invalid anchor. If we check whether a cursor is valid, we should also check the anchor_. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33012 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/Cursor.cpp b/src/Cursor.cpp index 0017e1ae14..542d1016b9 100644 --- a/src/Cursor.cpp +++ b/src/Cursor.cpp @@ -2142,9 +2142,12 @@ Font Cursor::getFont() const bool Cursor::fixIfBroken() { - if (DocIterator::fixIfBroken()) { - clearSelection(); - return true; + bool const broken_cursor = DocIterator::fixIfBroken(); + bool const broken_anchor = anchor_.fixIfBroken(); + + if (broken_cursor || broken_anchor) { + clearSelection(); + return true; } return false; }