aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-04-26 00:10:17 +0800
committerChris Lahey <clahey@src.gnome.org>2001-04-26 00:10:17 +0800
commitc6f76217ea749ec14609f9ce0718f57ae8749aec (patch)
treecab7e27d880f8e164e789f0567dc08e91eeb752b /widgets/table
parente420ccde448b6ad165c256bc088025288a51284f (diff)
downloadgsoc2013-evolution-c6f76217ea749ec14609f9ce0718f57ae8749aec.tar
gsoc2013-evolution-c6f76217ea749ec14609f9ce0718f57ae8749aec.tar.gz
gsoc2013-evolution-c6f76217ea749ec14609f9ce0718f57ae8749aec.tar.bz2
gsoc2013-evolution-c6f76217ea749ec14609f9ce0718f57ae8749aec.tar.lz
gsoc2013-evolution-c6f76217ea749ec14609f9ce0718f57ae8749aec.tar.xz
gsoc2013-evolution-c6f76217ea749ec14609f9ce0718f57ae8749aec.tar.zst
gsoc2013-evolution-c6f76217ea749ec14609f9ce0718f57ae8749aec.zip
Made this return -1 instead of -2 for not found if the root is not
2001-04-25 Christopher James Lahey <clahey@ximian.com> * 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
Diffstat (limited to 'widgets/table')
-rw-r--r--widgets/table/e-tree-selection-model.c2
-rw-r--r--widgets/table/e-tree-table-adapter.c9
2 files changed, 8 insertions, 3 deletions
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)