mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-26 19:25:39 +00:00
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 9e1db65932
)
This commit is contained in:
parent
1c4bc08be7
commit
9886bf96c1
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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) ?
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user