mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 05:25:26 +00:00
Fix bug 5146. The problem arose when attempting to paste normal text into
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
This commit is contained in:
parent
2455bc258f
commit
9374e68bfd
@ -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
|
||||
|
@ -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?
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user