X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-var-sheet.c;h=0708bf3e047f8c416ce0d2cc6500a7ad75282520;hb=e93857e0338c2a71794db2b57e3659bbe6946240;hp=60b968ef811eb84f97ad9a8b172bb2f9328e1276;hpb=806d578c678996f8c6e34d8d91331126eedb22ac;p=pspp-builds.git diff --git a/src/ui/gui/psppire-var-sheet.c b/src/ui/gui/psppire-var-sheet.c index 60b968ef..0708bf3e 100644 --- a/src/ui/gui/psppire-var-sheet.c +++ b/src/ui/gui/psppire-var-sheet.c @@ -254,19 +254,18 @@ change_measure (GtkComboBox *cb, Returns TRUE iff the move should be disallowed */ static gboolean traverse_cell_callback (GtkSheet *sheet, - gint row, gint column, - gint *new_row, gint *new_column) + const GtkSheetCell *existing_cell, + GtkSheetCell *new_cell) { PsppireVarSheet *var_sheet = PSPPIRE_VAR_SHEET (sheet); PsppireVarStore *var_store = PSPPIRE_VAR_STORE (gtk_sheet_get_model (sheet)); gint n_vars = psppire_var_store_get_var_cnt (var_store); - if (*new_row >= n_vars && !var_sheet->may_create_vars) + if (new_cell->row >= n_vars && !var_sheet->may_create_vars) return TRUE; - - if ( row == n_vars && *new_row >= n_vars) + if ( existing_cell->row == n_vars && new_cell->row >= n_vars) { GtkEntry *entry = GTK_ENTRY (gtk_sheet_get_entry (sheet)); @@ -275,7 +274,7 @@ traverse_cell_callback (GtkSheet *sheet, if (! psppire_dict_check_name (var_store->dict, name, TRUE)) return TRUE; - psppire_dict_insert_variable (var_store->dict, row, name); + psppire_dict_insert_variable (var_store->dict, existing_cell->row, name); return FALSE; } @@ -284,16 +283,15 @@ traverse_cell_callback (GtkSheet *sheet, /* If the destination cell is outside the current variables, then automatically create variables for the new rows. */ - if ( ((*new_row > n_vars) || - (*new_row == n_vars && *new_column != PSPPIRE_VAR_STORE_COL_NAME)) ) + if ( ((new_cell->row > n_vars) || + (new_cell->row == n_vars && + new_cell->col != PSPPIRE_VAR_STORE_COL_NAME)) ) { gint i; - for ( i = n_vars ; i <= *new_row; ++i ) + for ( i = n_vars ; i <= new_cell->row; ++i ) psppire_dict_insert_variable (var_store->dict, i, NULL); } - - return FALSE; }