From: John Darrington Date: Mon, 24 Nov 2008 13:45:20 +0000 (+0900) Subject: Fix problem inserting variables at end of var sheet X-Git-Tag: v0.7.1~117 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e35dcfae42bfcb56df35038c6acf42d3bc5a6e62;p=pspp-builds.git Fix problem inserting variables at end of var sheet --- diff --git a/lib/gtksheet/psppire-axis.c b/lib/gtksheet/psppire-axis.c index a3609afa..c83c6b46 100644 --- a/lib/gtksheet/psppire-axis.c +++ b/lib/gtksheet/psppire-axis.c @@ -166,7 +166,10 @@ psppire_axis_insert (PsppireAxis *a, gint size, gint posn) { struct tower_node *new = pool_malloc (a->pool, sizeof *new); - struct tower_node *before = tower_get (&a->tower, posn); + struct tower_node *before = NULL; + + if ( posn != tower_count (&a->tower)) + before = tower_get (&a->tower, posn); tower_insert (&a->tower, size, new, before); } diff --git a/src/ui/gui/psppire-data-editor.c b/src/ui/gui/psppire-data-editor.c index 2e1dee89..505cf4a1 100644 --- a/src/ui/gui/psppire-data-editor.c +++ b/src/ui/gui/psppire-data-editor.c @@ -301,7 +301,6 @@ psppire_data_editor_set_property (GObject *object, g_signal_connect (de->data_store->dict, "backend-changed", G_CALLBACK (new_variables_callback), de); g_signal_connect (de->data_store->dict, "variable-inserted", G_CALLBACK (insert_variable_callback), de); g_signal_connect (de->data_store->dict, "variable-deleted", G_CALLBACK (delete_variable_callback), de); - // g_signal_connect (de->data_store->dict, "variable-changed", G_CALLBACK (alter_variable_callback), de); g_signal_connect (de->data_store->dict, "variable-display-width-changed", G_CALLBACK (rewidth_variable_callback), de); break; case PROP_VAR_STORE: