From: Martin Vermeer Date: Wed, 22 Mar 2006 08:46:54 +0000 (+0000) Subject: * math_gridinset.C (MathGridInset::doDispatch): reset cur.pos() when X-Git-Tag: 1.6.10~13463 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=cc91bd643f72f58077893e15e736340945d6e4fd;p=features.git * math_gridinset.C (MathGridInset::doDispatch): reset cur.pos() when deleting current col or row git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13450 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/math_gridinset.C b/src/mathed/math_gridinset.C index 3ca1497450..9d82ec69d2 100644 --- a/src/mathed/math_gridinset.C +++ b/src/mathed/math_gridinset.C @@ -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();