From: Juergen Spitzmueller Date: Sun, 2 Mar 2014 12:21:59 +0000 (+0100) Subject: Fix crash after undo following replacement of a multicell selection (#8973). X-Git-Tag: 2.1.0rc1~134 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=4824f7c9db8301550c1bc53c340fbeae916a46f3;hp=6b35bb75446d8e06e38dc7a6b47e30109a0471ff;p=lyx.git Fix crash after undo following replacement of a multicell selection (#8973). --- diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 60a0157cb3..b124743446 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -4328,8 +4328,16 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd) if (cur.selIsMultiCell()) { cur.recordUndoInset(DELETE_UNDO); cutSelection(cur); - } - cell(cur.idx())->dispatch(cur, cmd); + BufferView * bv = &cur.bv(); + docstring::const_iterator cit = cmd.argument().begin(); + docstring::const_iterator const end = cmd.argument().end(); + for (; cit != end; ++cit) + bv->translateAndInsert(*cit, getText(cur.idx()), cur); + + cur.resetAnchor(); + bv->bookmarkEditPosition(); + } else + cell(cur.idx())->dispatch(cur, cmd); break; case LFUN_CHAR_DELETE_BACKWARD: