]> git.lyx.org Git - features.git/commitdiff
Fix bug3782, crash with selection of table cells, joint work with JMarc
authorBo Peng <bpeng@lyx.org>
Thu, 7 Jun 2007 21:55:55 +0000 (21:55 +0000)
committerBo Peng <bpeng@lyx.org>
Thu, 7 Jun 2007 21:55:55 +0000 (21:55 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18709 a592a061-630c-0410-9148-cb99ea01b6c8

src/CutAndPaste.cpp
src/Text3.cpp
src/insets/InsetTabular.cpp

index 85c6b122f7ec214b6b4cbd2c8154ae41260f2b9f..c8438b02372126aca61a781bc08bca919980584a 100644 (file)
@@ -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);
index 85187f50fa41292367c5135de12523968bcacf95..c02773c77ea0861de52c7d455e34e7015dc705aa 100644 (file)
@@ -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;
 
index 5d14a54eafae45de495623b54347475c597718ca..05a1801d246b439bbca5594928cfa0a3210e0f57 100644 (file)
@@ -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);