aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-07-07 14:00:15 +0800
committerChris Lahey <clahey@src.gnome.org>2001-07-07 14:00:15 +0800
commit5304dda169dd9778def88176572bb76eeaf0883b (patch)
treeeda6a760e5bdedd99ab23b58c1b382dca585840d /mail
parent622ee65eb612e8f492b17538df95ed2e2d709466 (diff)
downloadgsoc2013-evolution-5304dda169dd9778def88176572bb76eeaf0883b.tar
gsoc2013-evolution-5304dda169dd9778def88176572bb76eeaf0883b.tar.gz
gsoc2013-evolution-5304dda169dd9778def88176572bb76eeaf0883b.tar.bz2
gsoc2013-evolution-5304dda169dd9778def88176572bb76eeaf0883b.tar.lz
gsoc2013-evolution-5304dda169dd9778def88176572bb76eeaf0883b.tar.xz
gsoc2013-evolution-5304dda169dd9778def88176572bb76eeaf0883b.tar.zst
gsoc2013-evolution-5304dda169dd9778def88176572bb76eeaf0883b.zip
Made this handle being given a row that's outside the range better.
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. svn path=/trunk/; revision=10881
Diffstat (limited to 'mail')
-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;