From edd997c8894491c74b9b908cbd1e5e9036d1c9c2 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Sat, 4 Aug 2001 03:14:49 +0000 Subject: e_tree_table_adapter_node_at_row would have pulled data from one past the 2001-08-03 Christopher James Lahey * e-tree-table-adapter.c (e_tree_table_adapter_node_at_row): e_tree_table_adapter_node_at_row would have pulled data from one past the end of its array if you asked it to and the root was hidden. Fixed it. Fixes Ximian bug #4761. svn path=/trunk/; revision=11647 --- widgets/table/e-tree-table-adapter.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/widgets/table/e-tree-table-adapter.c b/widgets/table/e-tree-table-adapter.c index 99c312c805..f432dcc53a 100644 --- a/widgets/table/e-tree-table-adapter.c +++ b/widgets/table/e-tree-table-adapter.c @@ -994,12 +994,14 @@ ETreePath e_tree_table_adapter_node_at_row (ETreeTableAdapter *etta, int row) { if (row < 0) return NULL; - if (row >= etta->priv->n_map) - return NULL; - if (etta->priv->root_visible) - return etta->priv->map_table[row]; - else - return etta->priv->map_table[row + 1]; + if (etta->priv->root_visible) { + if (row < etta->priv->n_map) + return etta->priv->map_table[row]; + } else { + if (row + 1 < etta->priv->n_map) + return etta->priv->map_table[row + 1]; + } + return NULL; } int e_tree_table_adapter_row_of_node (ETreeTableAdapter *etta, ETreePath path) -- cgit