diff options
-rw-r--r-- | widgets/table/e-table-subset.c | 20 | ||||
-rw-r--r-- | widgets/table/e-table-subset.h | 21 |
2 files changed, 33 insertions, 8 deletions
diff --git a/widgets/table/e-table-subset.c b/widgets/table/e-table-subset.c index 4edb093d26..95eb85433e 100644 --- a/widgets/table/e-table-subset.c +++ b/widgets/table/e-table-subset.c @@ -368,6 +368,26 @@ e_table_subset_new (ETableModel *source, const int nvals) return (ETableModel *) etss; } +int e_table_subset_model_to_view_row (ETableSubset *ets, + int model_row) +{ + int i; + for (i = 0; i < ets->n_map; i++) { + if (ets->map_table[i] == model_row) + return i; + } + return -1; +} + +int e_table_subset_view_to_model_row (ETableSubset *ets, + int view_row) +{ + if (view_row >= 0 && view_row < ets->n_map) + return ets->map_table[view_row]; + else + return -1; +} + ETableModel * e_table_subset_get_toplevel (ETableSubset *table) { diff --git a/widgets/table/e-table-subset.h b/widgets/table/e-table-subset.h index cd26fbb203..68f68321aa 100644 --- a/widgets/table/e-table-subset.h +++ b/widgets/table/e-table-subset.h @@ -43,16 +43,21 @@ typedef struct { void (*proxy_model_rows_deleted) (ETableSubset *etss, ETableModel *etm, int row, int count); } ETableSubsetClass; -GtkType e_table_subset_get_type (void); -ETableModel *e_table_subset_new (ETableModel *etm, - int n_vals); -ETableModel *e_table_subset_construct (ETableSubset *ets, - ETableModel *source, - int nvals); +GtkType e_table_subset_get_type (void); +ETableModel *e_table_subset_new (ETableModel *etm, + int n_vals); +ETableModel *e_table_subset_construct (ETableSubset *ets, + ETableModel *source, + int nvals); -ETableModel *e_table_subset_get_toplevel (ETableSubset *table_model); +int e_table_subset_model_to_view_row (ETableSubset *ets, + int model_row); +int e_table_subset_view_to_model_row (ETableSubset *ets, + int view_row); -void e_table_subset_print_debugging (ETableSubset *table_model); +ETableModel *e_table_subset_get_toplevel (ETableSubset *table_model); + +void e_table_subset_print_debugging (ETableSubset *table_model); #ifdef __cplusplus } |