1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 1995 Matthias Ettrich
7 * Copyright 1995-2001 The LyX Team.
9 * ====================================================== */
14 #pragma implementation
17 #include "undostack.h"
19 #include "paragraph.h"
22 UndoStack::UndoStack()
26 Undo * UndoStack::pop()
28 if (stakk.empty()) return 0;
29 Undo * result = stakk.front();
35 Undo * UndoStack::top()
37 if (stakk.empty()) return 0;
42 UndoStack::~UndoStack()
48 void UndoStack::clear()
50 while (!stakk.empty()) {
51 Undo * tmp = stakk.front();
58 void UndoStack::SetStackLimit(Stakk::size_type l)
64 void UndoStack::push(Undo * undo_arg)
66 if (!undo_arg) return;
68 stakk.push_front(undo_arg);
69 if (stakk.size() > limit) {
70 Undo * tmp = stakk.back();
77 bool UndoStack::empty() const {