| 256 | } |
| 257 | |
| 258 | void UndoManager::removeAction(UndoAction *action, bool noDelete) |
| 259 | { |
| 260 | Vector<UndoAction*>::iterator itr = mUndoStack.begin(); |
| 261 | while (itr != mUndoStack.end()) |
| 262 | { |
| 263 | if ((*itr) == action) |
| 264 | { |
| 265 | UndoAction* deleteAction = *itr; |
| 266 | mUndoStack.erase(itr); |
| 267 | doRemove( deleteAction, noDelete ); |
| 268 | return; |
| 269 | } |
| 270 | itr++; |
| 271 | } |
| 272 | |
| 273 | itr = mRedoStack.begin(); |
| 274 | while (itr != mRedoStack.end()) |
| 275 | { |
| 276 | if ((*itr) == action) |
| 277 | { |
| 278 | UndoAction* deleteAction = *itr; |
| 279 | mRedoStack.erase(itr); |
| 280 | doRemove( deleteAction, noDelete ); |
| 281 | return; |
| 282 | } |
| 283 | itr++; |
| 284 | } |
| 285 | } |
| 286 | |
| 287 | void UndoManager::doRemove( UndoAction* action, bool noDelete ) |
| 288 | { |
no test coverage detected