two bits for cursor navigation inside insets

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8428 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Alfredo Braunstein 2004-02-13 09:43:02 +00:00
parent 4bcfc43c29
commit 83f68485ee
2 changed files with 7 additions and 3 deletions

View File

@ -1,3 +1,7 @@
2004-02-13 Alfredo Braunstein <abraunst@lyx.org>
* text2.C (cursorUp, cursorDown): fix coords
(moveUp): fix crash
2004-02-12 André Pönitz <poenitz@gmx.net>

View File

@ -1400,7 +1400,7 @@ DispatchResult LyXText::moveLeftIntern(LCursor & cur,
DispatchResult LyXText::moveUp(LCursor & cur)
{
if (cur.par() == 0 && cur.row() == 0)
if (cur.par() == 0 && cur.crow() == 0)
return DispatchResult(false, FINISHED_UP);
cursorUp(cur, false);
cur.clearSelection();
@ -1468,7 +1468,7 @@ void LyXText::cursorUp(LCursor & cur, bool selecting)
Row const & row = cur.textRow();
int x = cur.x_target();
int y = cursorY(cur.current()) - row.baseline() - 1;
setCursorFromCoordinates(x, y);
setCursorFromCoordinates(cur.current(), x - xo_, y - yo_);
if (!selecting) {
InsetBase * inset_hit = checkInsetHit(cur.x_target(), y);
@ -1483,7 +1483,7 @@ void LyXText::cursorDown(LCursor & cur, bool selecting)
Row const & row = cur.textRow();
int x = cur.x_target();
int y = cursorY(cur.current()) - row.baseline() + row.height() + 1;
setCursorFromCoordinates(cur.current(), x, y);
setCursorFromCoordinates(cur.current(), x - xo_, y - yo_);
if (!selecting) {
InsetBase * inset_hit = checkInsetHit(cur.x_target(), y);