fix cursor movement (up/down) problem at the end of lines in insets and table cells.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18293 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Bernhard Roider 2007-05-13 19:53:06 +00:00
parent 3121dd4269
commit 5d9e65058c

View File

@ -991,10 +991,10 @@ bool Text::cursorUp(Cursor & cur)
else
row = pm.pos2row(cur.pos());
// remember current position only if we are not at the end of a row.
if (cur.pos() != pm.rows()[row].endpos())
cur.setTargetX();
int const x = cur.targetX();
int x = cur.targetX();
cur.setTargetX();
if (cur.pos() != pm.rows()[row].endpos() || x < cur.targetX())
x = cur.targetX();
if (!cur.selection()) {
int const y = bv_funcs::getPos(cur.bv(), cur, cur.boundary()).y_;
@ -1050,10 +1050,10 @@ bool Text::cursorDown(Cursor & cur)
else
row = pm.pos2row(cur.pos());
// remember current position only if we are not at the end of a row.
if (cur.pos() != pm.rows()[row].endpos())
cur.setTargetX();
int const x = cur.targetX();
int x = cur.targetX();
cur.setTargetX();
if (cur.pos() != pm.rows()[row].endpos() || x < cur.targetX())
x = cur.targetX();
if (!cur.selection()) {
int const y = bv_funcs::getPos(cur.bv(), cur, cur.boundary()).y_;