Пример #1
0
/**
 * 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()
}
Пример #2
0
/**
 * Ends the current undo cycle.
 */
void RS_Undo::endUndoCycle() {
    addUndoCycle(currentCycle);
    currentCycle = NULL;
}