Code

C++ cleanup on patch.
authorJon A. Cruz <jon@joncruz.org>
Thu, 2 Dec 2010 08:34:41 +0000 (00:34 -0800)
committerJon A. Cruz <jon@joncruz.org>
Thu, 2 Dec 2010 08:34:41 +0000 (00:34 -0800)
src/widgets/toolbox.cpp

index a6740fceca76aa36fc764c545973cc261e0c0062..ce71a097ea4211e868d3754f8cfe3782e1e39e29 100644 (file)
@@ -8060,22 +8060,17 @@ static void connector_tb_event_attr_changed(Inkscape::XML::Node *repr,
 {
     GtkWidget *tbl = GTK_WIDGET(data);
 
-    if (g_object_get_data(G_OBJECT(tbl), "freeze")) {
-        return;
-    }
-    if (strcmp(name, "inkscape:connector-spacing") != 0) {
-        return;
-    }
+    if ( !g_object_get_data(G_OBJECT(tbl), "freeze")
+         && (strcmp(name, "inkscape:connector-spacing") == 0) ) {
+        GtkAdjustment *adj = static_cast<GtkAdjustment*>(gtk_object_get_data(GTK_OBJECT(tbl), "spacing"));
+        gdouble spacing = defaultConnSpacing;
+        sp_repr_get_double(repr, "inkscape:connector-spacing", &spacing);
 
-    GtkAdjustment *adj = (GtkAdjustment*)
-            gtk_object_get_data(GTK_OBJECT(tbl), "spacing");
-    gdouble spacing = defaultConnSpacing;
-    sp_repr_get_double(repr, "inkscape:connector-spacing", &spacing);
+        gtk_adjustment_set_value(adj, spacing);
+        gtk_adjustment_value_changed(adj);
 
-    gtk_adjustment_set_value(adj, spacing);
-    gtk_adjustment_value_changed(adj);
-
-    spinbutton_defocus(GTK_OBJECT(tbl));
+        spinbutton_defocus(GTK_OBJECT(tbl));
+    }
 }
 
 static void sp_connector_new_connection_point(GtkWidget *, GObject *tbl)