diff options
Diffstat (limited to 'widgets/table/e-table-sorter.c')
-rw-r--r-- | widgets/table/e-table-sorter.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/widgets/table/e-table-sorter.c b/widgets/table/e-table-sorter.c index a103e3cd85..08c7c1b120 100644 --- a/widgets/table/e-table-sorter.c +++ b/widgets/table/e-table-sorter.c @@ -524,3 +524,29 @@ e_table_sorter_sorted_to_model (ETableSorter *sorter, int row) else return row; } + +void +e_table_sorter_get_model_to_sorted_array (ETableSorter *sorter, int **array, int *count) +{ + if (array || count) { + ets_backsort(sorter); + + if (array) + *array = sorter->backsorted; + if (count) + *count = e_table_model_row_count(sorter->source); + } +} + +void +e_table_sorter_get_sorted_to_model_array (ETableSorter *sorter, int **array, int *count) +{ + if (array || count) { + ets_sort(sorter); + + if (array) + *array = sorter->sorted; + if (count) + *count = e_table_model_row_count(sorter->source); + } +} |