commit 9886bf96c1b0ce3c035d8b7191b2c85c252cc426 Author: Jean-Marc Lasgouttes <lasgout...@lyx.org> Date: Fri Jan 8 19:27:19 2021 +0100
Move handling of LFUN_COPY to BufferView 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 | 9 +++++++++ src/Text3.cpp | 6 ------ src/insets/InsetTabular.cpp | 10 ---------- src/mathed/InsetMathNest.cpp | 5 ----- status.23x | 3 +++ 5 files changed, 12 insertions(+), 21 deletions(-) diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 0788036..ba8ba83 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -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); diff --git a/src/Text3.cpp b/src/Text3.cpp index 7064603..1c99614 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -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; diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index ba00da7..b88d782 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -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) ? diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp index db03dab..d581e74 100644 --- a/src/mathed/InsetMathNest.cpp +++ b/src/mathed/InsetMathNest.cpp @@ -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; diff --git a/status.23x b/status.23x index 3fbb0d7..048e964 100644 --- a/status.23x +++ b/status.23x @@ -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 -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs