]> git.lyx.org Git - lyx.git/commitdiff
fix crash on 'page up' near the top of the UserGuide
authorAndré Pönitz <poenitz@gmx.net>
Thu, 23 Oct 2003 15:44:48 +0000 (15:44 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Thu, 23 Oct 2003 15:44:48 +0000 (15:44 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7972 a592a061-630c-0410-9148-cb99ea01b6c8

src/text3.C

index 4f5078cb25ed1884d379af1331a9ee732da698f2..0ad744b2afbc9377673f1f4dc117bc3198f79464 100644 (file)
@@ -269,24 +269,27 @@ void LyXText::cursorPrevious()
                return;
                // This is what we used to do, so we wouldn't skip right past
                // tall rows, but it's not working right now.
+       }
+
+       if (inset_owner) {
+               new_y = bv()->text->cursor.y()
+                       + bv()->theLockingInset()->insetInInsetY() + y
+                       + rit->height()
+                       - bv()->workHeight() + 1;
        } else {
-               if (inset_owner) {
-                       new_y = bv()->text->cursor.y()
-                               + bv()->theLockingInset()->insetInInsetY() + y
-                               + rit->height()
-                               - bv()->workHeight() + 1;
-               } else {
-                       new_y = cursor.y()
-                               - rit->baseline()
-                               + rit->height()
-                               - bv()->workHeight() + 1;
-               }
+               new_y = cursor.y()
+                       - rit->baseline()
+                       + rit->height()
+                       - bv()->workHeight() + 1;
        }
 
        LyXCursor cur;
        rit = cursorRow();
        ParagraphList::iterator pit = cursorPar();
        rit = cursorRow();
+       if (isFirstRow(pit, *rit))
+               return;
+
        previousRow(pit, rit);
        setCursor(cur, parOffset(pit), rit->pos(), false);
        if (cur.y() > bv_owner->top_y())