35 // ----------------------------------------------------------------------------- |
35 // ----------------------------------------------------------------------------- |
36 void History::undo() |
36 void History::undo() |
37 { if (m_changesets.size() == 0 || pos() == -1) |
37 { if (m_changesets.size() == 0 || pos() == -1) |
38 return; |
38 return; |
39 |
39 |
40 const list& set = changeset (pos()); |
40 const Changeset& set = changeset (pos()); |
41 g_fullRefresh = false; |
41 g_fullRefresh = false; |
42 |
42 |
43 // Iterate the list in reverse and undo all actions |
43 // Iterate the list in reverse and undo all actions |
44 for (const AbstractHistoryEntry* change : c_rev<AbstractHistoryEntry*> (set)) |
44 for (const AbstractHistoryEntry* change : c_rev<AbstractHistoryEntry*> (set)) |
45 change->undo(); |
45 change->undo(); |
58 // ----------------------------------------------------------------------------- |
58 // ----------------------------------------------------------------------------- |
59 void History::redo() |
59 void History::redo() |
60 { if (pos() == (long) m_changesets.size()) |
60 { if (pos() == (long) m_changesets.size()) |
61 return; |
61 return; |
62 |
62 |
63 const list& set = changeset (pos() + 1); |
63 const Changeset& set = changeset (pos() + 1); |
64 g_fullRefresh = false; |
64 g_fullRefresh = false; |
65 |
65 |
66 // Redo things - in the order as they were done in the first place |
66 // Redo things - in the order as they were done in the first place |
67 for (const AbstractHistoryEntry* change : set) |
67 for (const AbstractHistoryEntry* change : set) |
68 change->redo(); |
68 change->redo(); |