fix LFUN_CUT and LFUN_PASTE in insettabular (bug 1799), partial restore of middle mouse button in tabular (see FIXME)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9719 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2005-03-17 15:57:41 +00:00
parent d13d6da879
commit fdfd858b02
2 changed files with 23 additions and 7 deletions

View File

@ -1,5 +1,9 @@
2005-03-17 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* insettabular.C (doDispatch): get middle mouse button back again
(partially), pass LFUN_CUT and LFUN_PASTE to insettext's dispatch
when only a part of the cell is selected (fix bug 1799)
* insettabular.C: handle some more character attributes in
M. Vermeers method (when multiple cells in tables are selected);
disable some more senseless lfuns when multiple cells are selected

View File

@ -455,8 +455,13 @@ void InsetTabular::doDispatch(LCursor & cur, FuncRequest & cmd)
break;
}
//if (cmd.button() == mouse_button::button2)
// dispatch(cur, FuncRequest(LFUN_PASTESELECTION, "paragraph"));
if (cmd.button() == mouse_button::button2) {
// FIXME: pasting multiple cells (with insettabular's own
// LFUN_PASTESELECTION still does not work! (jspitzm)
cmd = FuncRequest(LFUN_PASTESELECTION, "paragraph");
cell(cur.idx())->dispatch(cur, cmd);
break;
}
// we'll pop up the table dialog on release
if (cmd.button() == mouse_button::button3)
@ -623,10 +628,14 @@ void InsetTabular::doDispatch(LCursor & cur, FuncRequest & cmd)
}
case LFUN_CUT:
if (copySelection(cur)) {
recordUndo(cur, Undo::DELETE);
cutSelection(cur);
if (tablemode(cur)) {
if (copySelection(cur)) {
recordUndo(cur, Undo::DELETE);
cutSelection(cur);
}
}
else
cell(cur.idx())->dispatch(cur, cmd);
break;
case LFUN_BACKSPACE:
@ -641,8 +650,11 @@ void InsetTabular::doDispatch(LCursor & cur, FuncRequest & cmd)
case LFUN_COPY:
if (!cur.selection())
break;
finishUndo();
copySelection(cur);
if (tablemode(cur)) {
finishUndo();
copySelection(cur);
} else
cell(cur.idx())->dispatch(cur, cmd);
break;
case LFUN_PASTESELECTION: {