From: John Darrington Date: Sat, 29 Jul 2006 09:37:18 +0000 (+0000) Subject: Made the variable sheet automatically add variables when clickes in a blank X-Git-Tag: v0.6.0~748 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb94372a328c69abcd2a8f4f68238fce5d64462b;p=pspp-builds.git Made the variable sheet automatically add variables when clickes in a blank row. --- diff --git a/src/ui/gui/var-sheet.c b/src/ui/gui/var-sheet.c index 4358c783..3145f13d 100644 --- a/src/ui/gui/var-sheet.c +++ b/src/ui/gui/var-sheet.c @@ -192,13 +192,15 @@ traverse_cell_callback (GtkSheet * sheet, } /* If the destination cell is outside the current variables, then - accept the destination only as the name column of the first blank row + automatically create variables for the new rows. */ - if ( *new_row > n_vars) - return FALSE; - - if ( *new_row >= n_vars && *new_column != COL_NAME) - return FALSE; + if ( (*new_row > n_vars) || + (*new_row == n_vars && *new_column != COL_NAME) ) + { + gint i; + for ( i = n_vars ; i <= *new_row; ++i ) + psppire_dict_insert_variable(var_store->dict, i, NULL); + } return TRUE; }