]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView.cpp
Fix bug #5540: Crash in MathAtom on Undo.
[lyx.git] / src / BufferView.cpp
index 44fa44ea624dc7b50ed91b93cc424f36a4bba9e0..b932332a3a8c32c828279b5926588ddd27a24ab0 100644 (file)
@@ -943,7 +943,7 @@ bool BufferView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
                flag.setEnabled(! this->cursor().inRegexped());
                break;
 
-       case LFUN_COPY_LABEL_AS_REF: {
+       case LFUN_LABEL_COPY_AS_REF: {
                // if there is an inset at cursor, see whether it
                // handles the lfun
                Inset * inset = cur.nextInset();
@@ -1358,7 +1358,7 @@ bool BufferView::dispatch(FuncRequest const & cmd)
                buffer_.params().compressed = !buffer_.params().compressed;
                break;
 
-       case LFUN_COPY_LABEL_AS_REF: {
+       case LFUN_LABEL_COPY_AS_REF: {
                // if there is an inset at cursor, try to copy it
                Inset * inset = &cur.inset();
                if (!inset || !inset->asInsetMath())
@@ -1403,14 +1403,17 @@ bool BufferView::dispatch(FuncRequest const & cmd)
        case LFUN_SCREEN_UP:
        case LFUN_SCREEN_DOWN: {
                Point p = getPos(cur, cur.boundary());
-               if (p.y_ < 0 || p.y_ > height_) {
+               // This code has been commented out to enable to scroll down a
+               // document, even if there are large insets in it (see bug #5465).
+               /*if (p.y_ < 0 || p.y_ > height_) {
                        // The cursor is off-screen so recenter before proceeding.
                        showCursor();
                        p = getPos(cur, cur.boundary());
-               }
+               }*/
                int const scrolled = scroll(cmd.action == LFUN_SCREEN_UP
                        ? - height_ : height_);
                if (cmd.action == LFUN_SCREEN_UP && scrolled > - height_)
+               if (cmd.action == LFUN_SCREEN_UP && scrolled > -height_)
                        p = Point(0, 0);
                if (cmd.action == LFUN_SCREEN_DOWN && scrolled < height_)
                        p = Point(width_, height_);