diff --git a/lib/doc/UserGuide.lyx b/lib/doc/UserGuide.lyx index 9c2b429752..fd15620493 100644 --- a/lib/doc/UserGuide.lyx +++ b/lib/doc/UserGuide.lyx @@ -19164,6 +19164,25 @@ This is a multiline entry in a table. \begin_layout Standard Cutting and pasting between tables and table cells works reasonably well. You can cut and paste even more than one row. +\begin_inset Foot +status open + +\begin_layout Plain Layout +Note, however, that you cannot paste into a multicell selection. + The reason is that it is simply not clear what LyX should do in this case. + If you select a 2x3 group of cells but paste just the word +\begin_inset Quotes eld +\end_inset + +the +\begin_inset Quotes erd +\end_inset + + (or a 3x5 group of cells) what should happen? +\end_layout + +\end_inset + Selection with the mouse or with \family sans Shift diff --git a/src/Text3.cpp b/src/Text3.cpp index be8e80feb4..ff971cb0b5 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -931,6 +931,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) case LFUN_PASTE: { cur.message(_("Paste")); + LASSERT(cur.selBegin().idx() == cur.selEnd().idx(), /**/); cap::replaceSelection(cur); // without argument? diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index e30af38382..22237df636 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -3754,11 +3754,16 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd, } case LFUN_PASTE: + if (cur.selBegin().idx() != cur.selEnd().idx()) { + status.setEnabled(false); + status.message(_("You cannot paste into a multicell selection.")); + return true; + } if (tabularStackDirty() && theClipboard().isInternal()) { status.setEnabled(true); return true; - } else - return cell(cur.idx())->getStatus(cur, cmd, status); + } + return cell(cur.idx())->getStatus(cur, cmd, status); case LFUN_INSET_MODIFY: if (insetCode(cmd.getArg(0)) == TABULAR_CODE) {