From bb94372a328c69abcd2a8f4f68238fce5d64462b Mon Sep 17 00:00:00 2001 From: John Darrington Date: Sat, 29 Jul 2006 09:37:18 +0000 Subject: [PATCH] Made the variable sheet automatically add variables when clickes in a blank row. --- src/ui/gui/var-sheet.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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; } -- 2.30.2