aboutsummaryrefslogtreecommitdiff
path: root/src/summaryview.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-09-22 02:54:01 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-09-22 02:54:01 +0000
commit2d8727b6a7f307563bd59ad071f144564ae8d7c3 (patch)
treea1a4199863ac254db32f784434f534ac86bd8022 /src/summaryview.c
parentf855f6b88c0333c99c7c07862fabf713e94c0985 (diff)
fixed crash when summary was sorted by logical columns.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1178 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/summaryview.c')
-rw-r--r--src/summaryview.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/summaryview.c b/src/summaryview.c
index 708a77c7..b626afc9 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -896,7 +896,8 @@ static void summary_unset_sort_column_id(SummaryView *summaryview)
GtkSortType order;
if (gtk_tree_sortable_get_sort_column_id
- (GTK_TREE_SORTABLE(summaryview->store), &id, &order)) {
+ (GTK_TREE_SORTABLE(summaryview->store), &id, &order) &&
+ id < N_SUMMARY_VISIBLE_COLS) {
GtkTreeViewColumn *column = summaryview->columns[id];
column->sort_column_id = -1;
gtk_tree_view_column_set_sort_indicator(column, FALSE);
@@ -2052,13 +2053,14 @@ void summary_sort(SummaryView *summaryview,
gtk_tree_sortable_set_sort_column_id(sortable, col_type,
(GtkSortType)sort_type);
- if (prev_col_type != -1 && col_type != prev_col_type) {
+ if (prev_col_type != -1 && col_type != prev_col_type &&
+ prev_col_type < N_SUMMARY_VISIBLE_COLS) {
column = summaryview->columns[prev_col_type];
column->sort_column_id = -1;
gtk_tree_view_column_set_sort_indicator(column, FALSE);
}
if (col_type != S_COL_MARK && col_type != S_COL_UNREAD &&
- col_type != S_COL_MIME) {
+ col_type != S_COL_MIME && col_type < N_SUMMARY_VISIBLE_COLS) {
column = summaryview->columns[col_type];
column->sort_column_id = col_type;
gtk_tree_view_column_set_sort_indicator(column, TRUE);