diff options
author | Christopher James Lahey <clahey@ximian.com> | 2001-08-21 02:22:46 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2001-08-21 02:22:46 +0800 |
commit | beba0c1009c68555b294c8ec18f1ecd49a0f184f (patch) | |
tree | 8c9d938c6048fc333f5a93e2a3cc7665f54858ef /widgets/table | |
parent | 4dd3f5e734c4582596bfdabc29ffcac8261fb74d (diff) | |
download | gsoc2013-evolution-beba0c1009c68555b294c8ec18f1ecd49a0f184f.tar.gz gsoc2013-evolution-beba0c1009c68555b294c8ec18f1ecd49a0f184f.tar.zst gsoc2013-evolution-beba0c1009c68555b294c8ec18f1ecd49a0f184f.zip |
Added these functions.
2001-08-20 Christopher James Lahey <clahey@ximian.com>
* e-table-subset.c, e-table-subset.h
(e_table_subset_model_to_view_row,
e_table_subset_view_to_model_row): Added these functions.
svn path=/trunk/; revision=12317
Diffstat (limited to 'widgets/table')
-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 } |