]> git.lyx.org Git - features.git/commitdiff
* math_gridinset.C (MathGridInset::doDispatch): reset cur.pos() when
authorMartin Vermeer <martin.vermeer@hut.fi>
Wed, 22 Mar 2006 08:46:54 +0000 (08:46 +0000)
committerMartin Vermeer <martin.vermeer@hut.fi>
Wed, 22 Mar 2006 08:46:54 +0000 (08:46 +0000)
deleting current col or row

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13450 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/math_gridinset.C

index 3ca1497450a44a34f746432e3fd3a88a59657721..9d82ec69d282211d6bf4adc3e948724a332ae06c 100644 (file)
@@ -1131,12 +1131,14 @@ void MathGridInset::doDispatch(LCursor & cur, FuncRequest & cmd)
                else if (s == "append-row")
                        for (int i = 0, n = extractInt(is); i < n; ++i)
                                addRow(cur.row());
-               else if (s == "delete-row")
+               else if (s == "delete-row") {
                        for (int i = 0, n = extractInt(is); i < n; ++i) {
                                delRow(cur.row());
                                if (cur.idx() > nargs())
                                        cur.idx() -= ncols();
                        }
+                       cur.pos() = 0; // trick, see below
+               }
                else if (s == "copy-row") {
                        // Here (as later) we save the cursor col/row 
                        // in order to restore it after operation. 
@@ -1173,6 +1175,7 @@ void MathGridInset::doDispatch(LCursor & cur, FuncRequest & cmd)
                        for (int i = 0, n = extractInt(is); i < n; ++i)
                                delCol(col(cur.idx()));
                        cur.idx() = index(r, min(c, cur.ncols() - 1));
+                       cur.pos() = 0; // trick, see above
                }
                else if (s == "copy-column") {
                        row_type const r = cur.row();