]> git.lyx.org Git - lyx.git/blobdiff - src/undo.C
add config.h
[lyx.git] / src / undo.C
index 536a2e4d5c161c6f8b43ab129ee84bc819e35134..33b97827325f006009e10dbcc3ef59165aa0c583 100644 (file)
@@ -17,6 +17,7 @@
 #include "undo.h"
 
 #include "buffer.h"
+#include "buffer_funcs.h"
 #include "cursor.h"
 #include "debug.h"
 #include "BufferView.h"
 #include "paragraph.h"
 #include "ParagraphList.h"
 
-#include "mathed/math_support.h"
+#include "mathed/MathSupport.h"
 #include "insets/inset.h"
 
 #include <algorithm>
 
-using lyx::pit_type;
+
+namespace lyx {
 
 using std::advance;
 using std::endl;
@@ -168,6 +170,7 @@ bool textUndoOrRedo(BufferView & bv,
                // We stored the full cell here as there is not much to be
                // gained by storing just 'a few' paragraphs (most if not
                // all math inset cells have just one paragraph!)
+               // lyxerr << "undo.array=" << to_ascii(undo.array) <<endl;
                asArray(undo.array, dit.cell());
        } else {
                // Some finer machinery is needed here.
@@ -193,6 +196,7 @@ bool textUndoOrRedo(BufferView & bv,
                for (; pit != end; ++pit)
                        pit->setInsetOwner(dit.realInset());
                plist.insert(first, undo.pars.begin(), undo.pars.end());
+               updateLabels(*buf);
        }
 
        // Set cursor
@@ -251,7 +255,9 @@ void recordUndoInset(LCursor & cur, Undo::undo_kind kind)
 {
        LCursor c = cur;
        c.pop();
-       recordUndo(c, kind);
+       Buffer * buf = cur.bv().buffer();
+       doRecordUndo(kind, c, c.pit(), c.pit(), cur,
+                    buf->params(), false, buf->undostack());
 }
 
 
@@ -288,3 +294,6 @@ void recordUndoFullDocument(BufferView * bv)
        );
        undo_finished = false;
 }
+
+
+} // namespace lyx