aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog5
-rw-r--r--mail/message-list.c13
2 files changed, 14 insertions, 4 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 6e09d51153..943c291fa9 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,8 @@
+2001-07-07 Christopher James Lahey <clahey@ximian.com>
+
+ * message-list.c (message_list_select): Made this handle being
+ given a row that's outside the range better.
+
2001-07-06 Jason Leach <jleach@ximian.com>
[Fix bug #1100, default account is stored strangely]
diff --git a/mail/message-list.c b/mail/message-list.c
index f5fb85c34a..583524821d 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -382,18 +382,23 @@ message_list_select (MessageList *message_list, int base_row,
break;
case MESSAGE_LIST_SELECT_NEXT:
last = e_tree_row_count (message_list->tree);
+ if (last <= base_row)
+ return;
break;
default:
g_warning("Invalid argument to message_list_select");
return;
}
- if (base_row == -1)
- base_row = e_tree_row_count(message_list->tree) - 1;
-
+ /* If it's -1, we want the last view row, not the last model row. */
/* model_to_view_row etc simply dont work for sorted views. Sigh. */
- vrow = e_tree_model_to_view_row (et, base_row);
+ if (base_row == -1)
+ vrow = e_tree_row_count(message_list->tree) - 1;
+ else
+ vrow = e_tree_model_to_view_row (et, base_row);
+ if (base_row <= -1)
+ return;
/* This means that we'll move at least one message in 'direction'. */
if (vrow != last)
vrow += direction;