From b9250f26a3bc94984bcd66df9585684abcd4af6d Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Sat, 30 Jan 2010 18:00:05 +0000 Subject: [PATCH] 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/branches/BRANCH_1_6_X@33281 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Cursor.cpp | 9 ++++++--- status.16x | 3 +++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Cursor.cpp b/src/Cursor.cpp index dfa51a6ce5..7d9a4576df 100644 --- a/src/Cursor.cpp +++ b/src/Cursor.cpp @@ -2109,9 +2109,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; } diff --git a/status.16x b/status.16x index 176a079fd8..acb2fec622 100644 --- a/status.16x +++ b/status.16x @@ -120,6 +120,9 @@ What's new - Fix a crash when closing a document with a pending autocompletion popup (bug 6431). + +- Fix a crash when trying to select a whole empty math inset. This causes + the empty inset to disappear and the anchor to be invalid (bug 6448). - While in ERT, disable non-functional sub- and superscript functions that crashed LyX (bug 6459).