From 33143ad856dffd6b0f98112379365774c98035f4 Mon Sep 17 00:00:00 2001 From: dvlierop2 Date: Mon, 27 Apr 2009 20:05:57 +0000 Subject: [PATCH] Make the snap toolbar unsensitive to undo actions. How could I not have noticed this bug before? --- src/widgets/toolbox.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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) -- 2.30.2