From 749c7626eb82cd791b8278b00f8b5b350d74114b Mon Sep 17 00:00:00 2001 From: Not Zed Date: Thu, 6 Feb 2003 02:17:14 +0000 Subject: use the parent path to find the parent node rather than the row, which is 2003-02-06 Not Zed * e-tree-table-adapter.c (delete_node): use the parent path to find the parent node rather than the row, which is not valid for the root node, which still needs its visible child count updated. svn path=/trunk/; revision=19797 --- widgets/table/e-tree-table-adapter.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'widgets/table') diff --git a/widgets/table/e-tree-table-adapter.c b/widgets/table/e-tree-table-adapter.c index 16411c19ec..60e228406c 100644 --- a/widgets/table/e-tree-table-adapter.c +++ b/widgets/table/e-tree-table-adapter.c @@ -269,6 +269,7 @@ delete_node(ETreeTableAdapter *etta, ETreePath parent, ETreePath path) int parent_row = get_row(etta, parent); int row = get_row(etta, path); GNode *gnode = lookup_gnode(etta, path); + GNode *parent_gnode = lookup_gnode(etta, parent); e_table_model_pre_change(E_TABLE_MODEL(etta)); @@ -283,10 +284,10 @@ delete_node(ETreeTableAdapter *etta, ETreePath parent, ETreePath path) move_map_elements(etta, row, row + to_remove, etta->priv->n_map - row - to_remove); resize_map(etta, etta->priv->n_map - to_remove); - if (parent_row != -1) { - node_t *parent_node = etta->priv->map_table[parent_row]; - GNode *parent_gnode = lookup_gnode(etta, parent); + if (parent_gnode != NULL) { + node_t *parent_node = parent_gnode->data; gboolean expandable = e_tree_model_node_is_expandable(etta->priv->source, parent); + update_child_counts(parent_gnode, - to_remove); if (parent_node->expandable != expandable) { e_table_model_pre_change(E_TABLE_MODEL(etta)); -- cgit