fixes a crash and a coord problem.

Alfredo

Index: text2.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text2.C,v
retrieving revision 1.543
diff -u -p -u -r1.543 text2.C
--- text2.C     13 Feb 2004 07:30:56 -0000      1.543
+++ text2.C     13 Feb 2004 08:45:51 -0000
@@ -1400,7 +1400,7 @@ DispatchResult LyXText::moveLeftIntern(L
 
 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, bo
        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, 
        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);

Reply via email to