aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'widgets')
-rw-r--r--widgets/misc/e-selection-model-array.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/widgets/misc/e-selection-model-array.c b/widgets/misc/e-selection-model-array.c
index 552e9536ad..13c964bfba 100644
--- a/widgets/misc/e-selection-model-array.c
+++ b/widgets/misc/e-selection-model-array.c
@@ -52,7 +52,6 @@ void
e_selection_model_array_delete_rows(ESelectionModelArray *esma, int row, int count)
{
if (esma->eba) {
-
if (E_SELECTION_MODEL(esma)->mode == GTK_SELECTION_SINGLE)
e_bit_array_delete_single_mode(esma->eba, row, count);
else
@@ -63,6 +62,14 @@ e_selection_model_array_delete_rows(ESelectionModelArray *esma, int row, int cou
else if (esma->cursor_row > row)
esma->cursor_row = row;
+ if (esma->cursor_row >= e_bit_array_bit_count (esma->eba)) {
+ esma->cursor_row = e_bit_array_bit_count (esma->eba) - 1;
+ } else if (esma->cursor_row < 0) {
+ esma->cursor_row = -1;
+ }
+ if (esma->cursor_row >= 0)
+ e_bit_array_change_one_row(esma->eba, esma->cursor_row, TRUE);
+
e_selection_model_selection_changed(E_SELECTION_MODEL(esma));
e_selection_model_cursor_changed(E_SELECTION_MODEL(esma), esma->cursor_row, esma->cursor_col);
}