aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-table-group-container.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-04-06 16:00:35 +0800
committerChris Lahey <clahey@src.gnome.org>2000-04-06 16:00:35 +0800
commitfe016cce581d311c97652e08fbd7bfcb4042bbe4 (patch)
tree8868c23051b29368e66a0801f819066dd02bcfa4 /widgets/table/e-table-group-container.c
parented50119936e0f078a21ea35e6bbe15b503063574 (diff)
downloadgsoc2013-evolution-fe016cce581d311c97652e08fbd7bfcb4042bbe4.tar
gsoc2013-evolution-fe016cce581d311c97652e08fbd7bfcb4042bbe4.tar.gz
gsoc2013-evolution-fe016cce581d311c97652e08fbd7bfcb4042bbe4.tar.bz2
gsoc2013-evolution-fe016cce581d311c97652e08fbd7bfcb4042bbe4.tar.lz
gsoc2013-evolution-fe016cce581d311c97652e08fbd7bfcb4042bbe4.tar.xz
gsoc2013-evolution-fe016cce581d311c97652e08fbd7bfcb4042bbe4.tar.zst
gsoc2013-evolution-fe016cce581d311c97652e08fbd7bfcb4042bbe4.zip
Got rid of some warnings.
2000-04-06 Christopher James Lahey <clahey@helixcode.com> * test-cols.c, test-table.c: Got rid of some warnings. * e-table-group-container.c, e-table-group-container.h, e-table-group-leaf.c, e-table-group-leaf.h, e-table-group.c, e-table-group.h, e-table-header-item.c, e-table-header-item.h, e-table-sort-info.c, e-table-sort-info.h, e-table-sorted-variable.c, e-table-sorted-variable.h, e-table.c, e-table.h: Changed ETableSortInfo to not use xml internally. svn path=/trunk/; revision=2305
Diffstat (limited to 'widgets/table/e-table-group-container.c')
-rw-r--r--widgets/table/e-table-group-container.c38
1 files changed, 26 insertions, 12 deletions
diff --git a/widgets/table/e-table-group-container.c b/widgets/table/e-table-group-container.c
index d5de4cf847..f660cd01c3 100644
--- a/widgets/table/e-table-group-container.c
+++ b/widgets/table/e-table-group-container.c
@@ -3,7 +3,7 @@
* E-Table-Group.c: Implements the grouping objects for elements on a table
*
* Author:
- * Chris Lahey (clahey@helixcode.com)
+ * Chris Lahey <clahey@helixcode.com>
* Miguel de Icaza (miguel@gnu.org)
*
* Copyright 1999, 2000 Helix Code, Inc.
@@ -88,6 +88,9 @@ etgc_destroy (GtkObject *object)
if (etgc->ecol){
gtk_object_unref (GTK_OBJECT(etgc->ecol));
}
+ if (etgc->sort_info){
+ gtk_object_unref (GTK_OBJECT(etgc->sort_info));
+ }
if (etgc->rect){
gtk_object_destroy (GTK_OBJECT(etgc->rect));
}
@@ -196,13 +199,24 @@ void
e_table_group_container_construct (GnomeCanvasGroup *parent, ETableGroupContainer *etgc,
ETableHeader *full_header,
ETableHeader *header,
- ETableModel *model, ETableCol *ecol, int ascending, xmlNode *child_rules)
+ ETableModel *model, ETableSortInfo *sort_info, int n)
{
+ ETableCol *col;
+ ETableSortColumn column = e_table_sort_info_grouping_get_nth(sort_info, n);
+
+ if (column.column > e_table_header_count (full_header))
+ col = e_table_header_get_columns (full_header)[e_table_header_count (full_header) - 1];
+ else
+ col = e_table_header_get_columns (full_header)[column.column];
+
e_table_group_construct (parent, E_TABLE_GROUP (etgc), full_header, header, model);
- etgc->ecol = ecol;
+ etgc->ecol = col;
gtk_object_ref (GTK_OBJECT(etgc->ecol));
- etgc->child_rules = child_rules;
- etgc->ascending = ascending;
+ etgc->sort_info = sort_info;
+ gtk_object_ref (GTK_OBJECT(etgc->sort_info));
+ etgc->n = n;
+ etgc->ascending = column.ascending;
+
etgc->font = gdk_font_load ("lucidasans-10");
if (!etgc->font){
@@ -252,18 +266,16 @@ e_table_group_container_construct (GnomeCanvasGroup *parent, ETableGroupContaine
ETableGroup *
e_table_group_container_new (GnomeCanvasGroup *parent, ETableHeader *full_header,
ETableHeader *header,
- ETableModel *model, ETableCol *ecol,
- int ascending, xmlNode *child_rules)
+ ETableModel *model, ETableSortInfo *sort_info, int n)
{
ETableGroupContainer *etgc;
g_return_val_if_fail (parent != NULL, NULL);
- g_return_val_if_fail (ecol != NULL, NULL);
etgc = gtk_type_new (e_table_group_container_get_type ());
e_table_group_container_construct (parent, etgc, full_header, header,
- model, ecol, ascending, child_rules);
+ model, sort_info, n);
return E_TABLE_GROUP (etgc);
}
@@ -581,7 +593,7 @@ etgc_add (ETableGroup *etg, gint row)
"fill_color", "black",
NULL);
child = e_table_group_new (GNOME_CANVAS_GROUP (etgc), etg->full_header,
- etg->header, etg->model, etgc->child_rules);
+ etg->header, etg->model, etgc->sort_info, etgc->n + 1);
gtk_signal_connect (GTK_OBJECT (child), "row_selection",
GTK_SIGNAL_FUNC (child_row_selection), etgc);
child_node->child = child;
@@ -795,8 +807,10 @@ etgc_reflow (GnomeCanvasItem *item, gint flags)
ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(item);
gboolean frozen;
- gtk_object_get (GTK_OBJECT(etgc), "frozen", &frozen, NULL);
-
+ gtk_object_get (GTK_OBJECT(etgc),
+ "frozen", &frozen,
+ NULL);
+
if (frozen){
etgc->idle = 0;
return;