From: John Darrington Date: Fri, 12 Dec 2008 07:24:57 +0000 (+0900) Subject: Fixed bug which manifested itself in the text import dialog X-Git-Tag: v0.7.1~42 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=93fc7c42afe96222b3593a4a8c55a6c3683645eb;p=pspp-builds.git Fixed bug which manifested itself in the text import dialog --- diff --git a/lib/gtksheet/gtksheet.c b/lib/gtksheet/gtksheet.c index ebd93213..65806151 100644 --- a/lib/gtksheet/gtksheet.c +++ b/lib/gtksheet/gtksheet.c @@ -422,7 +422,7 @@ static void gtk_sheet_forall (GtkContainer *container, GtkCallback callback, gpointer callback_data); -static void gtk_sheet_set_scroll_adjustments (GtkSheet *sheet, +static gboolean gtk_sheet_set_scroll_adjustments (GtkSheet *sheet, GtkAdjustment *hadjustment, GtkAdjustment *vadjustment); @@ -1636,7 +1636,7 @@ gtk_sheet_get_visible_range (GtkSheet *sheet, GtkSheetRange *range) } -static void +static gboolean gtk_sheet_set_scroll_adjustments (GtkSheet *sheet, GtkAdjustment *hadjustment, GtkAdjustment *vadjustment) @@ -1646,24 +1646,34 @@ gtk_sheet_set_scroll_adjustments (GtkSheet *sheet, if (sheet->vadjustment) g_object_unref (sheet->vadjustment); sheet->vadjustment = vadjustment; - g_object_ref (vadjustment); - g_signal_connect (sheet->vadjustment, "value_changed", - G_CALLBACK (vadjustment_value_changed), - sheet); + if ( vadjustment) + { + g_object_ref (vadjustment); + + g_signal_connect (sheet->vadjustment, "value_changed", + G_CALLBACK (vadjustment_value_changed), + sheet); + } } if ( sheet->hadjustment != hadjustment ) { if (sheet->hadjustment) g_object_unref (sheet->hadjustment); + sheet->hadjustment = hadjustment; - g_object_ref (hadjustment); - g_signal_connect (sheet->hadjustment, "value_changed", - G_CALLBACK (hadjustment_value_changed), - sheet); + if ( hadjustment) + { + g_object_ref (hadjustment); + + g_signal_connect (sheet->hadjustment, "value_changed", + G_CALLBACK (hadjustment_value_changed), + sheet); + } } + return TRUE; } static void @@ -1769,8 +1779,6 @@ gtk_sheet_realize (GtkWidget *widget) sheet = GTK_SHEET (widget); - GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED); - colormap = gtk_widget_get_colormap (widget); display = gtk_widget_get_display (widget); @@ -1891,6 +1899,9 @@ gtk_sheet_realize (GtkWidget *widget) draw_column_title_buttons (sheet); gtk_sheet_update_primary_selection (sheet); + + + GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED); } static void