diff options
author | Christopher James Lahey <clahey@helixcode.com> | 2000-05-05 08:10:32 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2000-05-05 08:10:32 +0800 |
commit | ccd8e1fedde7a29acb5e10ade7e69b9197e65dbe (patch) | |
tree | 5c5d9b1d535b32aca4eb6926df4e968c2b4bd2ab /widgets/table/e-table-subset-variable.c | |
parent | ad3ee0de0244facb7bd2eed03805b68d01022601 (diff) | |
download | gsoc2013-evolution-ccd8e1fedde7a29acb5e10ade7e69b9197e65dbe.tar gsoc2013-evolution-ccd8e1fedde7a29acb5e10ade7e69b9197e65dbe.tar.gz gsoc2013-evolution-ccd8e1fedde7a29acb5e10ade7e69b9197e65dbe.tar.bz2 gsoc2013-evolution-ccd8e1fedde7a29acb5e10ade7e69b9197e65dbe.tar.lz gsoc2013-evolution-ccd8e1fedde7a29acb5e10ade7e69b9197e65dbe.tar.xz gsoc2013-evolution-ccd8e1fedde7a29acb5e10ade7e69b9197e65dbe.tar.zst gsoc2013-evolution-ccd8e1fedde7a29acb5e10ade7e69b9197e65dbe.zip |
Add an e_table_group_add_all function and implement it in the different
2000-05-04 Christopher James Lahey <clahey@helixcode.com>
* e-table-group-container.c, e-table-group-leaf.c,
e-table-group.c, e-table-group.h: Add an e_table_group_add_all
function and implement it in the different ETableGroup classes.
* e-table-sort-info.c: Make set_nth not call changed twice if it
needs to allocate more space.
* e-table-sorted-variable.c, e-table-subset-variable.c,
e-table-subset-variable.h: Add and implement an
e_table_subset_variable_add_all command.
* e-table.c: Use e_table_group_add_all as appropriate. Fix ETable
grouping xml to work if there is a text element at the bottom of
the grouping tree.
svn path=/trunk/; revision=2806
Diffstat (limited to 'widgets/table/e-table-subset-variable.c')
-rw-r--r-- | widgets/table/e-table-subset-variable.c | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/widgets/table/e-table-subset-variable.c b/widgets/table/e-table-subset-variable.c index 35cd4f9deb..bd96d5360c 100644 --- a/widgets/table/e-table-subset-variable.c +++ b/widgets/table/e-table-subset-variable.c @@ -38,6 +38,24 @@ etssv_add (ETableSubsetVariable *etssv, e_table_model_changed (etm); } +static void +etssv_add_all (ETableSubsetVariable *etssv) +{ + ETableModel *etm = E_TABLE_MODEL(etssv); + ETableSubset *etss = E_TABLE_SUBSET(etssv); + int rows = e_table_model_row_count(etss->source); + int i; + + if (etss->n_map + rows > etssv->n_vals_allocated){ + etssv->n_vals_allocated += MAX(INCREMENT_AMOUNT, rows); + etss->map_table = g_realloc (etss->map_table, etssv->n_vals_allocated * sizeof(int)); + } + for (i = 0; i < rows; i++) + etss->map_table[etss->n_map++] = i; + if (!etm->frozen) + e_table_model_changed (etm); +} + static gboolean etssv_remove (ETableSubsetVariable *etssv, gint row) @@ -64,8 +82,9 @@ etssv_class_init (GtkObjectClass *object_class) ETableSubsetVariableClass *klass = E_TABLE_SUBSET_VARIABLE_CLASS(object_class); etssv_parent_class = gtk_type_class (PARENT_TYPE); - klass->add = etssv_add; - klass->remove = etssv_remove; + klass->add = etssv_add; + klass->add_all = etssv_add_all; + klass->remove = etssv_remove; } E_MAKE_TYPE(e_table_subset_variable, "ETableSubsetVariable", ETableSubsetVariable, etssv_class_init, NULL, PARENT_TYPE); @@ -105,6 +124,16 @@ e_table_subset_variable_add (ETableSubsetVariable *etssv, ETSSV_CLASS (etssv)->add (etssv, row); } +void +e_table_subset_variable_add_all (ETableSubsetVariable *etssv) +{ + g_return_if_fail (etssv != NULL); + g_return_if_fail (E_IS_TABLE_SUBSET_VARIABLE(etssv)); + + if (ETSSV_CLASS(etssv)->add_all) + ETSSV_CLASS (etssv)->add_all (etssv); +} + gboolean e_table_subset_variable_remove (ETableSubsetVariable *etssv, gint row) |