From 99a26e26b6baa23d331721bb5168bd51be969b3a Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Mon, 28 Apr 2003 21:22:28 +0000 Subject: fix logic for updating selection after a delete when @move_selection_mode 2003-04-28 Chris Toshok * gal/util/e-bit-array.c (e_bit_array_delete_real): fix logic for updating selection after a delete when @move_selection_mode == TRUE. svn path=/trunk/; revision=20997 --- e-util/e-bit-array.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e-util/e-bit-array.c b/e-util/e-bit-array.c index 2a79e1bab2..bb98a3f465 100644 --- a/e-util/e-bit-array.c +++ b/e-util/e-bit-array.c @@ -97,8 +97,8 @@ e_bit_array_delete_real(EBitArray *eba, int row, gboolean move_selection_mode) if ((eba->bit_count & 0x1f) == 0) { eba->data = g_renew(guint32, eba->data, eba->bit_count >> 5); } - if (move_selection_mode && selected) { - e_bit_array_select_single_row (eba, row > 0 ? row - 1 : 0); + if (move_selection_mode && selected && eba->bit_count > 0) { + e_bit_array_select_single_row (eba, row == eba->bit_count ? row - 1 : row); } } } -- cgit