aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-08-04 11:14:49 +0800
committerChris Lahey <clahey@src.gnome.org>2001-08-04 11:14:49 +0800
commitedd997c8894491c74b9b908cbd1e5e9036d1c9c2 (patch)
tree0d1a2695da3825466ce54629214956a3a46bdca6
parenta874d1e407014751ae72957679c89dc6bbe2f679 (diff)
downloadgsoc2013-evolution-edd997c8894491c74b9b908cbd1e5e9036d1c9c2.tar
gsoc2013-evolution-edd997c8894491c74b9b908cbd1e5e9036d1c9c2.tar.gz
gsoc2013-evolution-edd997c8894491c74b9b908cbd1e5e9036d1c9c2.tar.bz2
gsoc2013-evolution-edd997c8894491c74b9b908cbd1e5e9036d1c9c2.tar.lz
gsoc2013-evolution-edd997c8894491c74b9b908cbd1e5e9036d1c9c2.tar.xz
gsoc2013-evolution-edd997c8894491c74b9b908cbd1e5e9036d1c9c2.tar.zst
gsoc2013-evolution-edd997c8894491c74b9b908cbd1e5e9036d1c9c2.zip
e_tree_table_adapter_node_at_row would have pulled data from one past the
2001-08-03 Christopher James Lahey <clahey@ximian.com> * 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
-rw-r--r--widgets/table/e-tree-table-adapter.c14
1 files 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)