aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--widgets/e-table/ChangeLog5
-rw-r--r--widgets/e-table/e-table-sorter.c10
-rw-r--r--widgets/table/e-table-sorter.c10
3 files changed, 17 insertions, 8 deletions
diff --git a/widgets/e-table/ChangeLog b/widgets/e-table/ChangeLog
index 29a3b3a588..8d404f0757 100644
--- a/widgets/e-table/ChangeLog
+++ b/widgets/e-table/ChangeLog
@@ -1,5 +1,10 @@
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.
+
+2000-08-05 Christopher James Lahey <clahey@helixcode.com>
+
* Makefile.am, e-table-selection-model.c,
e-table-selection-model.h, e-table.c, e-table.h: Made selection
ranges work even if the table is sorted.
diff --git a/widgets/e-table/e-table-sorter.c b/widgets/e-table/e-table-sorter.c
index 6da1c01e76..eb2391b0d0 100644
--- a/widgets/e-table/e-table-sorter.c
+++ b/widgets/e-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);
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);