]> git.lyx.org Git - features.git/commitdiff
fix undo in grids
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Fri, 8 Jul 2005 09:12:34 +0000 (09:12 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Fri, 8 Jul 2005 09:12:34 +0000 (09:12 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10149 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/ChangeLog
src/mathed/math_gridinset.C

index bf6420f5de5412c91f11036fd326144aaefb3d0e..229ecc577898194c7d9f84967145e08fe834db00 100644 (file)
@@ -1,3 +1,8 @@
+2005-07-07  Georg Baum  <Georg.Baum@post.rwth-aachen.de>
+
+       * math_gridinset.C (doDispatch): use recordUndoInset when more than
+       one cell is changed
+
 2005-07-06  Georg Baum  <Georg.Baum@post.rwth-aachen.de>
 
        * math_gridinset.C (doDispatch): better fix for the assertion
index 4946fdf576832ed8b0ea4905e72b73c82ff92350..ccb4efade13b3b7baf2cab6e37bbe8e7e3c9f14e 100644 (file)
@@ -1040,7 +1040,7 @@ void MathGridInset::doDispatch(LCursor & cur, FuncRequest & cmd)
 
        // insert file functions
        case LFUN_DELETE_LINE_FORWARD:
-               recordUndo(cur);
+               recordUndoInset(cur);
                //autocorrect_ = false;
                //macroModeClose();
                //if (selection_) {
@@ -1061,7 +1061,7 @@ void MathGridInset::doDispatch(LCursor & cur, FuncRequest & cmd)
                break;
 
        case LFUN_BREAKLINE: {
-               recordUndo(cur);
+               recordUndoInset(cur);
                row_type const r = cur.row();
                addRow(r);
 
@@ -1082,7 +1082,7 @@ void MathGridInset::doDispatch(LCursor & cur, FuncRequest & cmd)
        }
 
        case LFUN_TABULAR_FEATURE: {
-               recordUndo(cur);
+               recordUndoInset(cur);
                //lyxerr << "handling tabular-feature " << cmd.argument << endl;
                istringstream is(cmd.argument);
                string s;
@@ -1172,7 +1172,6 @@ void MathGridInset::doDispatch(LCursor & cur, FuncRequest & cmd)
        }
 
        case LFUN_PASTE: {
-               recordUndo(cur);
                lyxerr << "MathGridInset: PASTE: " << cmd << std::endl;
                istringstream is(cmd.argument);
                int n = 0;
@@ -1181,10 +1180,12 @@ void MathGridInset::doDispatch(LCursor & cur, FuncRequest & cmd)
                mathed_parse_normal(grid, lyx::cap::getSelection(cur.buffer(), n));
                if (grid.nargs() == 1) {
                        // single cell/part of cell
+                       recordUndo(cur);
                        cur.cell().insert(cur.pos(), grid.cell(0));
                        cur.pos() += grid.cell(0).size();
                } else {
                        // multiple cells
+                       recordUndoInset(cur);
                        col_type const numcols =
                                min(grid.ncols(), ncols() - col(cur.idx()));
                        row_type const numrows =
@@ -1316,7 +1317,7 @@ bool MathGridInset::getStatus(LCursor & cur, FuncRequest const & cmd,
 
 #if 0
                // FIXME: What did this code do?
-               // Please check wether it is still needed!
+               // Please check whether it is still needed!
                // should be more precise
                if (v_align_ == '\0') {
                        flag.enable(true);