1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 1995 Matthias Ettrich
7 * Copyright 1995-1999 The LyX Team.
9 * ====================================================== */
16 #pragma implementation
19 UndoStack::UndoStack()
23 Undo * UndoStack::pop()
25 if (stakk.empty()) return 0;
26 Undo * result = stakk.front();
32 Undo * UndoStack::top()
34 if (stakk.empty()) return 0;
39 UndoStack::~UndoStack()
45 void UndoStack::clear()
47 while (!stakk.empty()) {
48 Undo * tmp = stakk.front();
55 void UndoStack::SetStackLimit(Stakk::size_type l)
61 void UndoStack::push(Undo * undo_arg)
63 if (!undo_arg) return;
65 stakk.push_front(undo_arg);
66 if (stakk.size() > limit) {
67 Undo * tmp = stakk.back();