From: dvlierop2 Date: Mon, 27 Apr 2009 20:05:57 +0000 (+0000) Subject: Make the snap toolbar unsensitive to undo actions. How could I not have noticed this... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=33143ad856dffd6b0f98112379365774c98035f4;p=inkscape.git Make the snap toolbar unsensitive to undo actions. How could I not have noticed this bug before? --- diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index fba4f58ce..fbcb397cf 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -1886,6 +1886,7 @@ void toggle_snap_callback (GtkToggleAction *act, gpointer data) { //data points SPDesktop *dt = reinterpret_cast(ptr); SPNamedView *nv = sp_desktop_namedview(dt); + SPDocument *doc = SP_OBJECT_DOCUMENT(nv); if (dt == NULL || nv == NULL) { g_warning("No desktop or namedview specified (in toggle_snap_callback)!"); @@ -1899,6 +1900,9 @@ void toggle_snap_callback (GtkToggleAction *act, gpointer data) { //data points return; } + bool saved = sp_document_get_undo_sensitive(doc); + sp_document_set_undo_sensitive(doc, false); + bool v = false; SPAttributeEnum attr = (SPAttributeEnum) GPOINTER_TO_INT(g_object_get_data(G_OBJECT(act), "SP_ATTR_INKSCAPE")); @@ -1980,8 +1984,9 @@ void toggle_snap_callback (GtkToggleAction *act, gpointer data) { //data points } // The snapping preferences are stored in the document, and therefore toggling makes the document dirty - SPDocument *doc = SP_OBJECT_DOCUMENT(nv); doc->setModifiedSinceSave(); + + sp_document_set_undo_sensitive(doc, saved); } void setup_snap_toolbox(GtkWidget *toolbox, SPDesktop *desktop)