Comment 4 for bug 1358520

Revision history for this message
jazzynico (jazzynico) wrote :

From src/document-undo.cpp:

" * \verbatim
   void sp_document_done( SPDocument *document );
   void sp_document_maybe_done( SPDocument *document, const unsigned char *key ) \endverbatim
 *
 * Both move the recent action list into the undo stack and clear the
 * list afterwards. While the first method does an unconditional push,
 * the second one first checks the key of the most recent stack entry. If
 * the keys are identical, the current action list is appended to the
 * existing stack entry, instead of pushing it onto its own. This
 * behaviour can be used to collect multi-step actions (like winding the
 * Gtk spinbutton) from the UI into a single undoable step."

Thus calling DocumentUndo::done for SP_VERB_LAYER_SOLO and SP_VERB_LAYER_LOCK_OTHERS in verbs.cpp would add a different undo history entry each time the actions are performed instead of one (all actions can be undone with a single undo action) currently.