]> git.lyx.org Git - features.git/commitdiff
Fix bug 1981
authorMartin Vermeer <martin.vermeer@hut.fi>
Fri, 19 Aug 2005 12:57:47 +0000 (12:57 +0000)
committerMartin Vermeer <martin.vermeer@hut.fi>
Fri, 19 Aug 2005 12:57:47 +0000 (12:57 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10399 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/ChangeLog
src/mathed/math_nestinset.C

index 676d68c9dc1657c2c7c97d1ee26cec1777ad77a3..749c44d56bdb468e273eaf32563f9e5ac7caba5d 100644 (file)
@@ -1,3 +1,9 @@
+
+2005-08-19  Martin Vermeer  <martin.vermeer@hut.fi>
+
+       * math_nestinset.C (doDispatch): fix crash when deleting across rows
+       in math array, and block multi-cell cut/copy leading to data loss
+
 2005-07-26  Georg Baum  <Georg.Baum@post.rwth-aachen.de>
 
        * math_factory.C (initSymbols): Don't require wasysym for the wasy
index a71327a84e455bbe11473dd3744f4dc27cc79d51..245055ef9ecad2e605cfa6ca584e25200f034793 100644 (file)
@@ -423,6 +423,7 @@ void MathNestInset::doDispatch(LCursor & cur, FuncRequest & cmd)
        }
 
        case LFUN_CUT:
+               cur.pos() = 0; // Prevent stale position >= size crash
                cutSelection(cur, true, true);
                cur.message(_("Cut"));
                break;
@@ -814,7 +815,9 @@ void MathNestInset::doDispatch(LCursor & cur, FuncRequest & cmd)
                if (rs.empty())
                        rs = ')';
                recordUndo(cur, Undo::ATOMIC);
-               cur.handleNest(MathAtom(new MathDelimInset(ls, rs)));
+               // Don't do this with multi-cell selections
+               if (cur.selBegin().idx() == cur.selEnd().idx())
+                       cur.handleNest(MathAtom(new MathDelimInset(ls, rs)));
                break;
        }