From 7b4aa24d8527b6d69d781148e0995658a96120b9 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Tue, 9 Jun 2009 19:47:08 +0800 Subject: [PATCH] Fixed bug inserting cases in data sheet. Cases were not being inserted in the correct position. --- src/ui/gui/psppire-data-editor.c | 10 +++++++--- src/ui/gui/psppire-data-window.c | 1 - 2 files changed, 7 insertions(+), 4 deletions(-) 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); } -- 2.30.2