a multicell selection. But the more I thought about this, the more it seemed
that pasting into multicell selections shouldn't be allowed. What exactly
ought to happen if the user selects a 2x3 grid of cells and then tries to
paste a 5x5 group of cells? LyX, anyway, just ignores the selection in this
case, which is not what the user will expect. So let's just not go there.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26099
a592a061-630c-0410-9148-
cb99ea01b6c8
\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
case LFUN_PASTE: {
cur.message(_("Paste"));
+ LASSERT(cur.selBegin().idx() == cur.selEnd().idx(), /**/);
cap::replaceSelection(cur);
// without argument?
}
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) {