src/editHistory.cpp

changeset 1065
c8ecddbd99e9
parent 1063
1f15c52c11f6
child 1072
9ce9496427f2
equal deleted inserted replaced
1064:4c7a353cf583 1065:c8ecddbd99e9
36 // Don't take the changes done here as actual edits to the document 36 // Don't take the changes done here as actual edits to the document
37 setIgnoring (true); 37 setIgnoring (true);
38 const Changeset& set = changesetAt (position()); 38 const Changeset& set = changesetAt (position());
39 39
40 // Iterate the list in reverse and undo all actions 40 // Iterate the list in reverse and undo all actions
41 for (int i = length(set) - 1; i >= 0; --i) 41 for (int i = countof(set) - 1; i >= 0; --i)
42 { 42 {
43 AbstractHistoryEntry* change = set[i]; 43 AbstractHistoryEntry* change = set[i];
44 change->undo(); 44 change->undo();
45 } 45 }
46 46
49 emit undone(); 49 emit undone();
50 } 50 }
51 51
52 void EditHistory::redo() 52 void EditHistory::redo()
53 { 53 {
54 if (position() == length(m_changesets)) 54 if (position() == countof(m_changesets))
55 return; 55 return;
56 56
57 setIgnoring (true); 57 setIgnoring (true);
58 const Changeset& set = changesetAt (position() + 1); 58 const Changeset& set = changesetAt (position() + 1);
59 59
108 m_currentChangeset << entry; 108 m_currentChangeset << entry;
109 } 109 }
110 110
111 int EditHistory::size() const 111 int EditHistory::size() const
112 { 112 {
113 return length(m_changesets); 113 return countof(m_changesets);
114 } 114 }
115 115
116 const EditHistory::Changeset& EditHistory::changesetAt (int pos) const 116 const EditHistory::Changeset& EditHistory::changesetAt (int pos) const
117 { 117 {
118 return m_changesets[pos]; 118 return m_changesets[pos];

mercurial