From 8358adf1acfb1a3c679f9f9fa71106c037587103 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Thu, 25 Apr 2002 20:45:03 +0000 Subject: Made these handle the case where all_children_selected_array has a bit 2002-04-25 Christopher James Lahey * e-tree-selection-model.c (etsm_selected_count_recurse, etsm_foreach_recurse): Made these handle the case where all_children_selected_array has a bit set, but the children of that node aren't filled in. svn path=/trunk/; revision=16590 --- widgets/table/e-tree-selection-model.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'widgets/table') diff --git a/widgets/table/e-tree-selection-model.c b/widgets/table/e-tree-selection-model.c index 29c641e879..c7799313f4 100644 --- a/widgets/table/e-tree-selection-model.c +++ b/widgets/table/e-tree-selection-model.c @@ -898,8 +898,11 @@ etsm_selected_count_recurse (ETreeSelectionModel *etsm, ETreePath child = e_tree_model_node_get_first_child(E_TREE_MODEL(etsm->priv->model), path); int i; for (i = 0; child && i < selection_node->num_children; i++, child = e_tree_model_node_get_next(E_TREE_MODEL(etsm->priv->model), child)) - if (selection_node->children[i]) + if (selection_node->all_children_selected_array && e_bit_array_value_at(selection_node->all_children_selected_array, i)) + etsm_selected_count_all_recurse (etsm, child, count); + else if (selection_node->children[i]) etsm_selected_count_recurse (etsm, selection_node->children[i], child, count); + } } @@ -1243,7 +1246,9 @@ etsm_foreach_recurse (ETreeSelectionModel *etsm, ETreePath child = e_tree_model_node_get_first_child(E_TREE_MODEL(etsm->priv->model), path); int i; for (i = 0; i < selection_node->num_children; i++, child = e_tree_model_node_get_next(E_TREE_MODEL(etsm->priv->model), child)) - if (selection_node->children[i]) + if (selection_node->all_children_selected_array && e_bit_array_value_at(selection_node->all_children_selected_array, i)) + etsm_foreach_all_recurse(etsm, child, callback, closure); + else if (selection_node->children[i]) etsm_foreach_recurse (etsm, selection_node->children[i], child, callback, closure); } } -- cgit