From c6f76217ea749ec14609f9ce0718f57ae8749aec Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Wed, 25 Apr 2001 16:10:17 +0000 Subject: Made this return -1 instead of -2 for not found if the root is not 2001-04-25 Christopher James Lahey * e-tree-table-adapter.c (e_tree_table_adapter_row_of_node): Made this return -1 instead of -2 for not found if the root is not visible. * e-tree-selection-model.c (etsm_row_foreach_cb): Made this accept any negative number as not found instead of just -1. svn path=/trunk/; revision=9562 --- widgets/table/e-tree-selection-model.c | 2 +- widgets/table/e-tree-table-adapter.c | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'widgets/table') diff --git a/widgets/table/e-tree-selection-model.c b/widgets/table/e-tree-selection-model.c index 6ae9f209a6..4c8a45c92d 100644 --- a/widgets/table/e-tree-selection-model.c +++ b/widgets/table/e-tree-selection-model.c @@ -750,7 +750,7 @@ etsm_row_foreach_cb (ETreePath path, gpointer user_data) { ModelAndCallback *mac = user_data; int row = etsm_row_of_node(mac->etsm, path); - if (row != -1) + if (row >= 0) mac->callback(row, mac->closure); } diff --git a/widgets/table/e-tree-table-adapter.c b/widgets/table/e-tree-table-adapter.c index caa513c4ad..bf15d1659b 100644 --- a/widgets/table/e-tree-table-adapter.c +++ b/widgets/table/e-tree-table-adapter.c @@ -999,8 +999,13 @@ int e_tree_table_adapter_row_of_node (ETreeTableAdapter *etta, ETreePath path { if (etta->priv->root_visible) return find_row_num(etta, path); - else - return find_row_num(etta, path) - 1; + else { + int row_num = find_row_num (etta, path); + if (row_num != -1) + return row_num - 1; + else + return row_num; + } } gboolean e_tree_table_adapter_root_node_is_visible(ETreeTableAdapter *etta) -- cgit