Changeset 7d2ee1 for src/Actions/ActionHistory.cpp
- Timestamp:
- Apr 23, 2021, 9:02:12 PM (5 years ago)
- Branches:
- Candidate_v1.7.0, stable
- Children:
- 7df863
- Parents:
- 3b7834
- git-author:
- Frederik Heber <frederik.heber@…> (04/10/21 07:58:48)
- git-committer:
- Frederik Heber <frederik.heber@…> (04/23/21 21:02:12)
- File:
-
- 1 edited
-
src/Actions/ActionHistory.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/ActionHistory.cpp
r3b7834 r7d2ee1 64 64 HistoryElement elem = history.back(); 65 65 LOG(1, "INFO: Undoing action " << elem.action->getName()); 66 if ((mark != NULL) && (mark== &elem)) {66 while ((!marked.empty()) && (marked.top() == &elem)) { 67 67 LOG(2, "DEBUG: Undoing marked item in ActionHistory, hence resetting mark."); 68 mark = NULL;68 marked.pop(); 69 69 } 70 70 history.pop_back(); … … 74 74 yrotsih.push_back(HistoryElement(elem.action,newState)); 75 75 } 76 76 77 void ActionHistory::redoLast(){ 77 78 if (!hasRedo()){ … … 98 99 99 100 void ActionHistory::setMark() { 100 mark = &(history.back()); 101 HistoryElement * const mark = &(history.back()); 102 ASSERT( mark != NULL, 103 "ActionHistory::setMark() - must not push NULL as element"); 104 marked.push(mark); 101 105 } 102 106 103 107 void ActionHistory::unsetMark() { 104 mark = NULL;108 marked.pop(); 105 109 } 106 110 107 111 void ActionHistory::undoTillMark() { 108 if (mark == NULL) {112 if (marked.empty()) { 109 113 undoLast(); 110 114 } else { 115 const HistoryElement * const mark = marked.top(); 111 116 while (mark != &(history.back())) 112 117 undoLast(); 118 marked.pop(); 113 119 } 114 120 }
Note:
See TracChangeset
for help on using the changeset viewer.
