From cab78cd062fbf93003014bc1d5825a24897b3106 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Sat, 5 Aug 2000 12:57:07 +0000 Subject: Made it so that selection ranges work even if the table is using grouping. 2000-08-05 Christopher James Lahey * e-table-sorter.c: Made it so that selection ranges work even if the table is using grouping. svn path=/trunk/; revision=4547 --- widgets/table/e-table-sorter.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'widgets/table/e-table-sorter.c') diff --git a/widgets/table/e-table-sorter.c b/widgets/table/e-table-sorter.c index 6da1c01e76..eb2391b0d0 100644 --- a/widgets/table/e-table-sorter.c +++ b/widgets/table/e-table-sorter.c @@ -185,12 +185,14 @@ ets_sort(ETableSorter *ets) int i; int j; int cols; + int group_cols; if (ets->sorted) return; rows = e_table_model_row_count(ets->source); - cols = e_table_sort_info_sorting_get_count(ets->sort_info) + e_table_sort_info_grouping_get_count(ets->sort_info); + group_cols = e_table_sort_info_grouping_get_count(ets->sort_info); + cols = e_table_sort_info_sorting_get_count(ets->sort_info) + group_cols; ets->sorted = g_new(int, rows); for (i = 0; i < rows; i++) @@ -207,10 +209,10 @@ ets_sort(ETableSorter *ets) ETableSortColumn column; ETableCol *col; - if (j < e_table_sort_info_sorting_get_count(ets->sort_info)) - column = e_table_sort_info_sorting_get_nth(ets->sort_info, j); - else + if (j < group_cols) column = e_table_sort_info_grouping_get_nth(ets->sort_info, j); + else + column = e_table_sort_info_sorting_get_nth(ets->sort_info, j - group_cols); if (column.column > e_table_header_count (ets->full_header)) col = e_table_header_get_column (ets->full_header, e_table_header_count (ets->full_header) - 1); -- cgit