]> git.lyx.org Git - lyx.git/blobdiff - src/undo.C
* Painter.h:
[lyx.git] / src / undo.C
index 536a2e4d5c161c6f8b43ab129ee84bc819e35134..fa377c3e548588d92f62c57a654f37097282eee6 100644 (file)
 #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;
@@ -95,7 +96,7 @@ void doRecordUndo(Undo::undo_kind kind,
        // fill in the real data to be saved
        if (cell.inMathed()) {
                // simply use the whole cell
-               undo.array = asString(cell.cell());
+               undo.array = to_utf8(asString(cell.cell()));
        } else {
                // some more effort needed here as 'the whole cell' of the
                // main LyXText _is_ the whole document.
@@ -168,7 +169,9 @@ 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!)
-               asArray(undo.array, dit.cell());
+               //lyxerr << "undo.array=" << undo.array <<endl;
+               // FIXME UNICODE
+               asArray(from_utf8(undo.array), dit.cell());
        } else {
                // Some finer machinery is needed here.
                LyXText * text = dit.text();
@@ -251,7 +254,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 +293,6 @@ void recordUndoFullDocument(BufferView * bv)
        );
        undo_finished = false;
 }
+
+
+} // namespace lyx