From: John Darrington Date: Thu, 27 Nov 2008 03:30:48 +0000 (+0900) Subject: Change return type of gtk_sheet_get_entry and removed an unused function. X-Git-Tag: v0.7.1~107^2~2 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8763a1e6f2dd8030900ea0bcaf0ce22c94e181bd;p=pspp-builds.git Change return type of gtk_sheet_get_entry and removed an unused function. --- diff --git a/lib/gtksheet/gtksheet.c b/lib/gtksheet/gtksheet.c index dcc7e2de..313727d2 100644 --- a/lib/gtksheet/gtksheet.c +++ b/lib/gtksheet/gtksheet.c @@ -2509,9 +2509,7 @@ gtk_sheet_entry_changed (GtkWidget *widget, gpointer data) sheet->active_cell.row = -1; sheet->active_cell.col = -1; - text = gtk_entry_get_text (GTK_ENTRY (gtk_sheet_get_entry (sheet))); - - + text = gtk_entry_get_text (gtk_sheet_get_entry (sheet)); if (text && strlen (text) > 0) { @@ -2626,7 +2624,7 @@ gtk_sheet_show_active_cell (GtkSheet *sheet) GTK_WIDGET_SET_FLAGS (GTK_WIDGET (sheet->entry_widget), GTK_VISIBLE); - sheet_entry = GTK_ENTRY (gtk_sheet_get_entry (sheet)); + sheet_entry = gtk_sheet_get_entry (sheet); gtk_sheet_get_attributes (sheet, row, col, &attributes); @@ -4525,7 +4523,7 @@ gtk_sheet_size_allocate_entry (GtkSheet *sheet) if (!GTK_WIDGET_REALIZED (GTK_WIDGET (sheet))) return; if (!GTK_WIDGET_MAPPED (GTK_WIDGET (sheet))) return; - sheet_entry = GTK_ENTRY (gtk_sheet_get_entry (sheet)); + sheet_entry = gtk_sheet_get_entry (sheet); if ( ! gtk_sheet_get_attributes (sheet, sheet->active_cell.row, sheet->active_cell.col, @@ -4612,7 +4610,7 @@ find_entry (GtkWidget *w, gpointer user_data) } -GtkWidget * +GtkEntry * gtk_sheet_get_entry (GtkSheet *sheet) { GtkWidget *w = sheet->entry_widget; @@ -4636,18 +4634,7 @@ gtk_sheet_get_entry (GtkSheet *sheet) } } - return w; -} - - -GtkWidget * -gtk_sheet_get_entry_widget (GtkSheet *sheet) -{ - g_return_val_if_fail (sheet != NULL, NULL); - g_return_val_if_fail (GTK_IS_SHEET (sheet), NULL); - g_return_val_if_fail (sheet->entry_widget != NULL, NULL); - - return (sheet->entry_widget); + return GTK_ENTRY (w); } diff --git a/lib/gtksheet/gtksheet.h b/lib/gtksheet/gtksheet.h index f400b107..bdb7ea32 100644 --- a/lib/gtksheet/gtksheet.h +++ b/lib/gtksheet/gtksheet.h @@ -234,7 +234,7 @@ gtk_sheet_new_with_custom_entry (GtkType entry_type); /* Change entry */ void gtk_sheet_change_entry (GtkSheet *sheet, GtkType entry_type); -GtkWidget *gtk_sheet_get_entry (GtkSheet *sheet); +GtkEntry *gtk_sheet_get_entry (GtkSheet *sheet); void gtk_sheet_get_selected_range (GtkSheet *sheet, diff --git a/src/ui/gui/psppire-var-sheet.c b/src/ui/gui/psppire-var-sheet.c index 493fd05c..c1730105 100644 --- a/src/ui/gui/psppire-var-sheet.c +++ b/src/ui/gui/psppire-var-sheet.c @@ -254,7 +254,7 @@ traverse_cell_callback (GtkSheet *sheet, if ( existing_cell->row == n_vars && new_cell->row >= n_vars) { - GtkEntry *entry = GTK_ENTRY (gtk_sheet_get_entry (sheet)); + GtkEntry *entry = gtk_sheet_get_entry (sheet); const gchar *name = gtk_entry_get_text (entry); @@ -319,12 +319,12 @@ var_sheet_change_active_cell (PsppireVarSheet *vs, { case PSPPIRE_VAR_STORE_COL_ALIGN: { + GtkEntry *entry; static GtkListStore *list_store = NULL; GtkComboBoxEntry *cbe; gtk_sheet_change_entry (sheet, GTK_TYPE_COMBO_BOX_ENTRY); - cbe = - GTK_COMBO_BOX_ENTRY (gtk_sheet_get_entry (sheet)->parent); - + entry = gtk_sheet_get_entry (sheet); + cbe = GTK_COMBO_BOX_ENTRY (GTK_WIDGET (entry)->parent); if ( ! list_store) list_store = create_label_list (alignments); @@ -340,12 +340,11 @@ var_sheet_change_active_cell (PsppireVarSheet *vs, case PSPPIRE_VAR_STORE_COL_MEASURE: { + GtkEntry *entry; GtkComboBoxEntry *cbe; gtk_sheet_change_entry (sheet, GTK_TYPE_COMBO_BOX_ENTRY); - cbe = - GTK_COMBO_BOX_ENTRY (gtk_sheet_get_entry (sheet)->parent); - - + entry = gtk_sheet_get_entry (sheet); + cbe = GTK_COMBO_BOX_ENTRY (GTK_WIDGET (entry)->parent); gtk_combo_box_set_model (GTK_COMBO_BOX (cbe), GTK_TREE_MODEL (vs_class->measure_list));