From: Bo Peng Date: Thu, 7 Jun 2007 21:55:55 +0000 (+0000) Subject: Fix bug3782, crash with selection of table cells, joint work with JMarc X-Git-Tag: 1.6.10~9447 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=3a5c55e30d4e2a41a9b82d1699c8db8c2b9fe5de;p=features.git Fix bug3782, crash with selection of table cells, joint work with JMarc git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18709 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp index 85c6b122f7..c8438b0237 100644 --- a/src/CutAndPaste.cpp +++ b/src/CutAndPaste.cpp @@ -607,6 +607,10 @@ void copySelectionToStack(Cursor & cur, CutStack & cutstack) if (!cur.selection()) return; + // copySelection can not yet handle the case of cross idx selection + if (cur.selBegin().idx() != cur.selEnd().idx()) + return; + if (cur.inTexted()) { Text * text = cur.text(); BOOST_ASSERT(text); diff --git a/src/Text3.cpp b/src/Text3.cpp index 85187f50fa..c02773c77e 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -489,8 +489,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) && cur.boundary() == oldBoundary) { cur.undispatched(); cmd = FuncRequest(LFUN_FINISHED_RIGHT); - } - if (cur.selection()) + } else if (cur.selection()) saveSelection(cur); break; diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 5d14a54eaf..05a1801d24 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -3265,7 +3265,11 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd) cell(cur.idx())->dispatch(cur, cmd); if (!cur.result().dispatched()) { isRightToLeft(cur) ? movePrevCell(cur) : moveNextCell(cur); - if (cmd.action == LFUN_CHAR_FORWARD_SELECT) + // The second case happens when LFUN_CHAR_FORWARD_SELECT + // is called, but the cursor is undispatched with cmd modified + // to LFUN_FINISHED_RIGHT (e.g. a case in bug 3782) + if (cmd.action == LFUN_CHAR_FORWARD_SELECT || + cmd.action == LFUN_FINISHED_RIGHT) saveSelection(cur); if (sl == cur.top()) cmd = FuncRequest(LFUN_FINISHED_RIGHT);