12 UndoDisabler() : blockedCommand_(std::nullopt) { blockAllCount_++; }
17 blockedCommands_.push_back(command);
24 auto it = std::find(blockedCommands_.begin(), blockedCommands_.end(), *blockedCommand_);
25 blockedCommands_.erase(it);
36 static bool isBlocked(UndoCommandType command)
38 return blockAllCount_ > 0 ||
39 std::find(blockedCommands_.begin(), blockedCommands_.end(), command) !=
40 blockedCommands_.end();
44 std::optional<UndoCommandType> blockedCommand_;
45 static inline std::vector<UndoCommandType> blockedCommands_;
46 static inline int blockAllCount_ = 0;
UndoDisabler(UndoCommandType command)
Blocks a specific undo command type while this object is alive.
Definition UndoDisabler.h:15