]> git.lyx.org Git - lyx.git/commitdiff
Move handling of LFUN_COPY to BufferView
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 8 Jan 2021 18:27:19 +0000 (19:27 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 11 Jan 2021 15:31:05 +0000 (16:31 +0100)
It turns out that the code is the same in texted ans mathed and that
whatever is done in InsetTabular is not useful.

This means that we do not need to deal Text::dispatch idiosyncrasies
(in particular forcing the cursor to be visible).

Fix bug #11225.

(cherry picked from commit 9e1db65932b895778525c48d524adfad2ae37739)

src/BufferView.cpp
src/Text3.cpp
src/insets/InsetTabular.cpp
src/mathed/InsetMathNest.cpp
status.23x

index 07880362552e29f8cc583b093c5c4d73615026f2..ba8ba830424caf8b565d9d1477d0ac7117147cfb 100644 (file)
@@ -1232,6 +1232,10 @@ bool BufferView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
                break;
        }
 
+       case LFUN_COPY:
+               flag.setEnabled(cur.selection());
+               break;
+
        default:
                return false;
        }
@@ -2153,6 +2157,11 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                break;
        }
 
+       case LFUN_COPY:
+               cap::copySelection(cur);
+               cur.message(_("Copy"));
+               break;
+
        default:
                // OK, so try the Buffer itself...
                buffer_.dispatch(cmd, dr);
index 70646036ed0c95a836696f36cc9a5cf14f50bb07..1c9961486114d8a3e912609f4d72149f3ff802bc 100644 (file)
@@ -1483,11 +1483,6 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                cur.message(_("Cut"));
                break;
 
-       case LFUN_COPY:
-               copySelection(cur);
-               cur.message(_("Copy"));
-               break;
-
        case LFUN_SERVER_GET_XY:
                cur.message(from_utf8(
                        convert<string>(tm->cursorX(cur.top(), cur.boundary()))
@@ -3118,7 +3113,6 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
                break;
 
        case LFUN_CUT:
-       case LFUN_COPY:
                enable = cur.selection();
                break;
 
index ba00da7a644b8f3aa438601b8f2b8b4c9d039681..b88d7826b3858618dfa7c8f290354a047d6b9246 100644 (file)
@@ -4527,16 +4527,6 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd)
                        cell(cur.idx())->dispatch(cur, cmd);
                break;
 
-       case LFUN_COPY:
-               if (!cur.selection())
-                       break;
-               if (cur.selIsMultiCell()) {
-                       cur.finishUndo();
-                       copySelection(cur);
-               } else
-                       cell(cur.idx())->dispatch(cur, cmd);
-               break;
-
        case LFUN_CLIPBOARD_PASTE:
        case LFUN_PRIMARY_SELECTION_PASTE: {
                docstring const clip = (act == LFUN_CLIPBOARD_PASTE) ?
index db03dabcafa3f65423c736b089c63b7511eef856..d581e74c96812f5313c15b2ec06c82c250b3d9e6 100644 (file)
@@ -566,11 +566,6 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
                cur.forceBufferUpdate();
                break;
 
-       case LFUN_COPY:
-               copySelection(cur);
-               cur.message(_("Copy"));
-               break;
-
        case LFUN_MOUSE_PRESS:
                lfunMousePress(cur, cmd);
                break;
index 3fbb0d74c844739afada68e0d30804b5a75307fb..048e964efeaff12bd49eaa622995692836bfb97e 100644 (file)
@@ -68,6 +68,9 @@ What's new
 
 - Fix Hebrew characters overflow in insets (bug 12030).
 
+- Fix unwanted scrolling of window when using "copy". (bug 11225).
+
+
 
 * INTERNALS