X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fdata-sheet.c;h=de4a357bf3d5c60991df18e2a29a91eebbda5f4c;hb=480a0746507ce73d26f528b56dc3ed80195096e0;hp=29e0309c9ea4eacff07a1dd43ae7b92f2a0fb84a;hpb=2dd0df69f627a06ffb887128d22e3d686d1cd207;p=pspp-builds.git diff --git a/src/ui/gui/data-sheet.c b/src/ui/gui/data-sheet.c index 29e0309c..de4a357b 100644 --- a/src/ui/gui/data-sheet.c +++ b/src/ui/gui/data-sheet.c @@ -44,20 +44,31 @@ extern GladeXML *xml; - static gboolean traverse_callback (GtkSheet * sheet, - gint row, gint col, - gint *new_row, gint *new_column - ) + gint row, gint col, + gint *new_row, gint *new_column + ) { + gint case_count; PsppireDataStore *data_store = PSPPIRE_DATA_STORE(gtk_sheet_get_model(sheet)); - const gint n_vars = psppire_dict_get_var_cnt(data_store->dict); if ( *new_column >= n_vars ) return FALSE; + case_count = psppire_case_file_get_case_count(data_store->case_file); + + if ( *new_row >= case_count ) + { + gint i; + + for ( i = case_count ; i <= *new_row; ++i ) + psppire_data_store_insert_new_case (data_store, i); + + return TRUE; + } + return TRUE; }