]> git.lyx.org Git - lyx.git/blobdiff - src/Undo.cpp
Add a preference option to specify the default length unit (cm or in).
[lyx.git] / src / Undo.cpp
index 9e00e5b336e37c0799bec8be7cfbf39f5625954b..7928c390966434ce9b6d3f0454f9de26dd749555 100644 (file)
@@ -241,6 +241,16 @@ Undo::~Undo()
 }
 
 
+void Undo::clear()
+{
+       d->undostack_.clear();
+       d->redostack_.clear();
+       d->undo_finished_ = true;
+       d->group_id = 0;
+       d->group_level = 0;
+}
+
+
 bool Undo::hasUndoStack() const
 {
        return !d->undostack_.empty();
@@ -352,6 +362,9 @@ void Undo::Private::recordUndo(UndoKind kind,
        // next time we'll try again to combine entries if possible
        undo_finished_ = false;
 
+       // If we ran recordUndo, it means that we plan to change the buffer
+       buffer_.markDirty();
+
        redostack_.clear();
        //lyxerr << "undostack:\n";
        //for (size_t i = 0, n = buf.undostack().size(); i != n && i < 6; ++i)
@@ -499,7 +512,9 @@ void Undo::endUndoGroup()
        }
 }
 
-
+// FIXME: remove these convenience functions and make
+// Private::recordUndo public as sole interface. The code in the
+// convenience functions can move to Cursor.cpp.
 
 void Undo::recordUndo(DocIterator const & cur, UndoKind kind)
 {