Fixed bug inserting cases in data sheet.
authorJohn Darrington <john@darrington.wattle.id.au>
Tue, 9 Jun 2009 11:47:08 +0000 (19:47 +0800)
committerJohn Darrington <john@darrington.wattle.id.au>
Tue, 9 Jun 2009 11:47:08 +0000 (19:47 +0800)
Cases were not being inserted in the correct position.

src/ui/gui/psppire-data-editor.c
src/ui/gui/psppire-data-window.c

index 7c3fca685eaa5e7d295455c4773584b649861ffd..212259f8c8b491983df970f99a712bc4345a8b12 100644 (file)
@@ -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;
 
index 1df084c1418c79339d458151ce25bb4ac4c07d82..185648bc0e9dd02c9905a8adf754090079dab2cf 100644 (file)
@@ -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);
 }