aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-08-05 20:57:07 +0800
committerChris Lahey <clahey@src.gnome.org>2000-08-05 20:57:07 +0800
commitcab78cd062fbf93003014bc1d5825a24897b3106 (patch)
tree260d228e01c51f0cf55c841fea238a3efe5ae2eb /widgets/table
parent78adc934b0946d1f4f4f6dacb393b4a119d68bec (diff)
downloadgsoc2013-evolution-cab78cd062fbf93003014bc1d5825a24897b3106.tar.gz
gsoc2013-evolution-cab78cd062fbf93003014bc1d5825a24897b3106.tar.zst
gsoc2013-evolution-cab78cd062fbf93003014bc1d5825a24897b3106.zip
Made it so that selection ranges work even if the table is using grouping.
2000-08-05 Christopher James Lahey <clahey@helixcode.com> * e-table-sorter.c: Made it so that selection ranges work even if the table is using grouping. svn path=/trunk/; revision=4547
Diffstat (limited to 'widgets/table')
-rw-r--r--widgets/table/e-table-sorter.c10
1 files changed, 6 insertions, 4 deletions
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);