From: John Darrington Date: Tue, 9 Jun 2009 11:47:08 +0000 (+0800) Subject: Fixed bug inserting cases in data sheet. X-Git-Tag: build37~74 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b4aa24d8527b6d69d781148e0995658a96120b9;p=pspp-builds.git Fixed bug inserting cases in data sheet. Cases were not being inserted in the correct position. --- diff --git a/src/ui/gui/psppire-data-editor.c b/src/ui/gui/psppire-data-editor.c index 7c3fca68..212259f8 100644 --- a/src/ui/gui/psppire-data-editor.c +++ b/src/ui/gui/psppire-data-editor.c @@ -1331,10 +1331,14 @@ psppire_data_editor_insert_case (PsppireDataEditor *de) { glong posn = -1; - if ( de->data_sheet[0]->state == PSPPIRE_SHEET_ROW_SELECTED ) - posn = PSPPIRE_SHEET (de->data_sheet[0])->range.row0; + if ( PSPPIRE_SHEET (de->data_sheet[0])->select_status == PSPPIRE_SHEET_ROW_SELECTED ) + { + posn = PSPPIRE_SHEET (de->data_sheet[0])->range.row0; + } else - posn = PSPPIRE_SHEET (de->data_sheet[0])->active_cell.row; + { + posn = PSPPIRE_SHEET (de->data_sheet[0])->active_cell.row; + } if ( posn == -1 ) posn = 0; diff --git a/src/ui/gui/psppire-data-window.c b/src/ui/gui/psppire-data-window.c index 1df084c1..185648bc 100644 --- a/src/ui/gui/psppire-data-window.c +++ b/src/ui/gui/psppire-data-window.c @@ -521,7 +521,6 @@ static void insert_case (GtkAction *action, gpointer data) { PsppireDataWindow *dw = PSPPIRE_DATA_WINDOW (data); - psppire_data_editor_insert_case (dw->data_editor); }