From 594f47b4b7ea59ec8a055d727c8fbf0bf2308a67 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Thu, 19 Nov 2009 23:12:15 +0000 Subject: [PATCH] branch: Fix bug #6320: LyX goes to infinite loop when selecting document parts. Set the boundary member correctly when the cursor goes to an 'empty' row. No status.16x entry needed as this was introduced by r31880. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@32111 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Cursor.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Cursor.cpp b/src/Cursor.cpp index b65033fa59..4869fbdedf 100644 --- a/src/Cursor.cpp +++ b/src/Cursor.cpp @@ -1894,8 +1894,15 @@ bool Cursor::upDownInText(bool up, bool & updateNeeded) if (update) { top().pos() = min(tm.x2pos(pit(), next_row, xo), top().lastpos()); - boundary(tm.x2pos(pit(), next_row, xo) - == tm.x2pos(pit(), next_row, tm.width())); + int const xpos = tm.x2pos(pit(), next_row, xo); + bool const at_end_row = xpos == tm.x2pos(pit(), next_row, tm.width()); + bool const at_beg_row = xpos == tm.x2pos(pit(), next_row, 0); + + if (at_end_row && at_beg_row) + // make sure the cursor ends up on this row + boundary(false); + else + boundary(at_end_row); } updateNeeded |= bv().checkDepm(*this, old); }