Avoid the need for an extra click when de-selecting a region
authorJohn Darrington <john@darrington.wattle.id.au>
Mon, 27 Jul 2009 10:51:36 +0000 (12:51 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Mon, 27 Jul 2009 10:51:36 +0000 (12:51 +0200)
lib/gtk-contrib/psppire-sheet.c

index 7c6d57d9a94d0d7688e3095fb4b023a16816afe9..c84d898984fbac6bfeaedfde639860183c4f0b19 100644 (file)
@@ -2898,7 +2898,8 @@ psppire_sheet_button_press (GtkWidget *widget, GdkEventButton *event)
                           sheet_signals[DOUBLE_CLICK_COLUMN], 0, column);
        }
     }
-  else if (event->window == sheet->row_title_window)
+  
+  if (event->window == sheet->row_title_window)
     {
       g_signal_emit (sheet,
                     sheet_signals[BUTTON_EVENT_ROW], 0,
@@ -2969,18 +2970,16 @@ psppire_sheet_button_press (GtkWidget *widget, GdkEventButton *event)
                        NULL, NULL, event->time);
       gtk_grab_add (GTK_WIDGET (sheet));
 
-      if (psppire_sheet_click_cell (sheet, row, column))
+      if ( sheet->select_status == PSPPIRE_SHEET_NORMAL)
        {
-         if ( sheet->select_status == PSPPIRE_SHEET_NORMAL)
-           {
-             sheet->range.row0 = row;
-             sheet->range.col0 = column;
-           }
-         else
-           {
-             psppire_sheet_unselect_range (sheet);
-           }
+         sheet->range.row0 = row;
+         sheet->range.col0 = column;
+       }
+      else
+       {
+         psppire_sheet_unselect_range (sheet);
        }
+      psppire_sheet_click_cell (sheet, row, column);
     }
 
   if (event->window == sheet->column_title_window)