mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +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.
This commit is contained in:
parent
474cb42e21
commit
9e1db65932
@ -1251,6 +1251,10 @@ bool BufferView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
|
||||
break;
|
||||
}
|
||||
|
||||
case LFUN_COPY:
|
||||
flag.setEnabled(cur.selection());
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@ -2187,6 +2191,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);
|
||||
|
@ -1548,11 +1548,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()))
|
||||
@ -3284,7 +3279,6 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
|
||||
break;
|
||||
|
||||
case LFUN_CUT:
|
||||
case LFUN_COPY:
|
||||
enable = cur.selection();
|
||||
break;
|
||||
|
||||
|
@ -5254,16 +5254,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) ?
|
||||
|
@ -558,11 +558,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;
|
||||
|
Loading…
Reference in New Issue
Block a user