BOOL OperationHistory::RedoNext() { ListItem* next; if (NowPtr == NULL) // If the NowPtr is NULL then if there are any redo operations then the first will be // found at the head of the OpHistoryList next = OpHistoryList.GetHead(); else // The first redo operation will be found after the NowPtr next = OpHistoryList.GetNext(NowPtr); if ( next != NULL) { Operation* pOp = (Operation*)next; BROADCAST_TO_ALL(OpMsg(pOp,OpMsg::BEFORE_REDO)); // There is an operation to redo if (pOp->Redo()) // REDO the operation { NowPtr = next; BROADCAST_TO_ALL(OpMsg(((Operation*)NowPtr), OpMsg::AFTER_REDO)); return (TRUE); } } return (FALSE); // There are no operations to REDO }
void ManipulatorOperation::Redo() { if (!m_lstRedo.empty()) { Operation* op = m_lstRedo.back(); op->Redo(); m_lstRedo.pop_back(); m_lstUndo.push_back(op); ++m_snapshot; } }