31 while (!list->empty())
49 InvokeEvent(RedoEmptyEvent());
52 if (0 != m_UndoLimit &&
m_UndoList.size() == m_UndoLimit)
60 InvokeEvent(UndoNotEmptyEvent());
75 int oeid = FirstObjectEventIdOfCurrentGroup(
86 int undoObjectEventId =
m_UndoList.back()->GetObjectEventId();
87 return Undo(undoObjectEventId);
102 InvokeEvent(RedoNotEmptyEvent());
106 InvokeEvent(UndoEmptyEvent());
110 }
while (
m_UndoList.back()->GetObjectEventId() >= oeid);
127 int redoObjectEventId =
m_RedoList.back()->GetObjectEventId();
128 return Redo(redoObjectEventId);
142 InvokeEvent(UndoNotEmptyEvent());
146 InvokeEvent(RedoEmptyEvent());
149 }
while (
m_RedoList.back()->GetObjectEventId() <= oeid);
159 InvokeEvent(UndoEmptyEvent());
162 InvokeEvent(RedoEmptyEvent());
168 InvokeEvent(RedoEmptyEvent());
183 if (undoLimit != m_UndoLimit)
189 m_UndoLimit = undoLimit;
212 if (opEvent->GetOperation() !=
nullptr && opEvent->GetOperation()->GetOperationType() == opType &&
213 opEvent->IsValid() && opEvent->GetDestination() == destination)
222 int currentGroupEventId = stack.back()->GetGroupEventId();
223 int firstObjectEventId = -1;
225 for (
auto iter = stack.rbegin(); iter != stack.rend(); ++iter)
227 if ((*iter)->GetGroupEventId() == currentGroupEventId)
229 firstObjectEventId = (*iter)->GetObjectEventId();
235 return firstObjectEventId;
bool Redo() override
Undoes the last changes.
std::vcl_size_t GetUndoLimit() const override
Gets the limit on the size of the undo history. The undo limit determines how many items can be store...
void ClearList(UndoContainer *list)
bool Undo() override
Undoes the last changes.
void ClearRedoList() override
Clears the RedoList.
abstract class, that can be used by Undo to undo an operation.
void Clear() override
Clears UndoList and RedoList.
~LimitedLinearUndo() override
static RenderingManager * GetInstance()
OperationEvent * GetLastOfType(OperationActor *destination, OperationType opType) override
Returns the last specified OperationEvent in Undo-list corresponding to the given values; if nothing ...
bool RedoListEmpty() override
True, if RedoList is empty.
Represents an entry of the undo or redo stack.
bool SetOperationEvent(UndoStackItem *stackItem) override
int GetLastGroupEventIdInList() override
Returns the GroupEventId of the top element in the OperationHistory.
std::deque< UndoStackItem * > UndoContainer
int GetLastObjectEventIdInList() override
Returns the ObjectEventId of the top element in the OperationHistory.
void RequestUpdateAll(RequestType type=REQUEST_UPDATE_ALL)
Represents a pair of operations: undo and the according redo.
void SetUndoLimit(std::vcl_size_t limit) override
Sets a limit on the size of the undo history. If the limit is reached, the oldest undo items will be ...