/** * Ends the current undo cycle. */ void RS_Undo::endUndoCycle() { if (0 < refCount) { // compensate nested calls of start-/endUndoCycle() if( 0 < --refCount) { // not the final nested call, nothing to do yet return; } } else { RS_DEBUG->print( RS_Debug::D_WARNING, "Warning: RS_Undo::endUndoCycle() called without previous startUndoCycle() %d", refCount); return; } if (hasUndoable()) { // only keep the undoCycle, when it contains undoables addUndoCycle(currentCycle); } setGUIButtons(); currentCycle = nullptr; // invalidate currentCycle for next startUndoCycle() }
/** * Ends the current undo cycle. */ void RS_Undo::endUndoCycle() { addUndoCycle(currentCycle); currentCycle = NULL; }