aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/e-table
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/e-table')
-rw-r--r--widgets/e-table/ChangeLog14
-rw-r--r--widgets/e-table/e-table-group-leaf.c8
-rw-r--r--widgets/e-table/e-table.c11
-rw-r--r--widgets/e-table/e-tree-model.c3
4 files changed, 30 insertions, 6 deletions
diff --git a/widgets/e-table/ChangeLog b/widgets/e-table/ChangeLog
index 3fba867267..f763b50eaf 100644
--- a/widgets/e-table/ChangeLog
+++ b/widgets/e-table/ChangeLog
@@ -1,3 +1,17 @@
+2000-08-28 Ettore Perazzoli <ettore@helixcode.com>
+
+ * e-table.c (et_destroy): Don't try to destroy the `header_canvas'
+ if NULL.
+
+ * e-table-group-leaf.c (etgl_set_cursor_row): If the item is NULL,
+ don't try to set the cursor row for it.
+
+ * e-table.c (set_scroll_adjustments): Don't set the adjustment for
+ the `header_canvas' unless the `header_canvas' is not NULL.
+
+ * e-tree-model.c (e_tree_model_row_of_node): If the node is the
+ root, just return -1 without emitting a warning.
+
2000-08-25 Christopher James Lahey <clahey@helixcode.com>
* e-table-col.c, e-table-config.c, e-table-header.c,
diff --git a/widgets/e-table/e-table-group-leaf.c b/widgets/e-table/e-table-group-leaf.c
index d083d44f21..082963a616 100644
--- a/widgets/e-table/e-table-group-leaf.c
+++ b/widgets/e-table/e-table-group-leaf.c
@@ -227,9 +227,11 @@ static void
etgl_set_cursor_row (ETableGroup *etg, gint row)
{
ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg);
- gnome_canvas_item_set(GNOME_CANVAS_ITEM(etgl->item),
- "cursor_row", row,
- NULL);
+
+ if (etgl->item != NULL)
+ gnome_canvas_item_set(GNOME_CANVAS_ITEM(etgl->item),
+ "cursor_row", row,
+ NULL);
}
static int
diff --git a/widgets/e-table/e-table.c b/widgets/e-table/e-table.c
index 7906ad877d..89f032b401 100644
--- a/widgets/e-table/e-table.c
+++ b/widgets/e-table/e-table.c
@@ -146,7 +146,10 @@ et_destroy (GtkObject *object)
gtk_object_unref (GTK_OBJECT (et->header));
gtk_object_unref (GTK_OBJECT (et->sort_info));
gtk_object_unref (GTK_OBJECT (et->sorter));
- gtk_widget_destroy (GTK_WIDGET (et->header_canvas));
+
+ if (et->header_canvas != NULL)
+ gtk_widget_destroy (GTK_WIDGET (et->header_canvas));
+
gtk_widget_destroy (GTK_WIDGET (et->table_canvas));
if (et->rebuild_idle_id) {
@@ -997,8 +1000,10 @@ set_scroll_adjustments (ETable *table,
hadjustment);
gtk_layout_set_vadjustment (GTK_LAYOUT(table->table_canvas),
vadjustment);
- gtk_layout_set_hadjustment (GTK_LAYOUT(table->header_canvas),
- hadjustment);
+
+ if (table->header_canvas != NULL)
+ gtk_layout_set_hadjustment (GTK_LAYOUT(table->header_canvas),
+ hadjustment);
}
gint
diff --git a/widgets/e-table/e-tree-model.c b/widgets/e-table/e-tree-model.c
index c57bf2d683..f6d8ddddd5 100644
--- a/widgets/e-table/e-tree-model.c
+++ b/widgets/e-table/e-tree-model.c
@@ -446,6 +446,9 @@ e_tree_model_row_of_node (ETreeModel *etree, ETreePath *node)
{
int i;
+ if (etree->root == node)
+ return -1;
+
for (i = 0; i < etree->row_array->len; i ++)
if (g_array_index (etree->row_array, GNode*, i) == node)
return i;