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
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;
}