| 22 | } |
| 23 | |
| 24 | bool mitk::VerboseLimitedLinearUndo::SetOperationEvent(UndoStackItem *undoStackItem) |
| 25 | { |
| 26 | if (!undoStackItem) |
| 27 | return false; |
| 28 | |
| 29 | // clear the redolist, if a new operation is saved |
| 30 | if (!m_RedoList.empty()) |
| 31 | { |
| 32 | this->ClearList(&m_RedoList); |
| 33 | InvokeEvent(RedoEmptyEvent()); |
| 34 | } |
| 35 | |
| 36 | std::size_t undoLimit = this->GetUndoLimit(); |
| 37 | if (0 != undoLimit && m_UndoList.size() == undoLimit) |
| 38 | { |
| 39 | auto item = m_UndoList.front(); |
| 40 | m_UndoList.pop_front(); |
| 41 | delete item; |
| 42 | } |
| 43 | m_UndoList.push_back(undoStackItem); |
| 44 | |
| 45 | InvokeEvent(UndoNotEmptyEvent()); |
| 46 | |
| 47 | return true; |
| 48 | } |
| 49 | |
| 50 | mitk::VerboseLimitedLinearUndo::StackDescription mitk::VerboseLimitedLinearUndo::GetUndoDescriptions() |
| 51 | { |
nothing calls this directly
no test coverage detected