aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-tree-table-adapter.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2002-07-19 16:02:50 +0800
committerChris Lahey <clahey@src.gnome.org>2002-07-19 16:02:50 +0800
commit56aad0a4c069eada71c1ef5eaaa9e18b08f1e59c (patch)
tree972de3292c98477500fa43caa93c0c796641a28b /widgets/table/e-tree-table-adapter.c
parentd0b60c1e81bb88826826be800ab58f1961f3d2a9 (diff)
downloadgsoc2013-evolution-56aad0a4c069eada71c1ef5eaaa9e18b08f1e59c.tar
gsoc2013-evolution-56aad0a4c069eada71c1ef5eaaa9e18b08f1e59c.tar.gz
gsoc2013-evolution-56aad0a4c069eada71c1ef5eaaa9e18b08f1e59c.tar.bz2
gsoc2013-evolution-56aad0a4c069eada71c1ef5eaaa9e18b08f1e59c.tar.lz
gsoc2013-evolution-56aad0a4c069eada71c1ef5eaaa9e18b08f1e59c.tar.xz
gsoc2013-evolution-56aad0a4c069eada71c1ef5eaaa9e18b08f1e59c.tar.zst
gsoc2013-evolution-56aad0a4c069eada71c1ef5eaaa9e18b08f1e59c.zip
Made these able to find the potential row for a new node which will be the
2002-07-19 Christopher James Lahey <clahey@ximian.com> * e-tree-table-adapter.c (find_next_node, find_first_child_node): Made these able to find the potential row for a new node which will be the last row. (find_row_num): Made this handle find_next_node and find_first_child_node returning n_map. svn path=/trunk/; revision=17517
Diffstat (limited to 'widgets/table/e-tree-table-adapter.c')
-rw-r--r--widgets/table/e-tree-table-adapter.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/widgets/table/e-tree-table-adapter.c b/widgets/table/e-tree-table-adapter.c
index cd376e40e0..20f41e6ebc 100644
--- a/widgets/table/e-tree-table-adapter.c
+++ b/widgets/table/e-tree-table-adapter.c
@@ -228,7 +228,7 @@ find_next_node(ETreeTableAdapter *adapter, int row)
ETreeTableAdapterNode *current = find_node (adapter, path);
if (next_sibling) {
row += (current ? current->num_visible_children : 0) + 1;
- if (row >= adapter->priv->n_map)
+ if (row > adapter->priv->n_map)
return -1;
return row;
} else
@@ -245,7 +245,7 @@ find_first_child_node(ETreeTableAdapter *adapter, int row)
ETreePath first_child = e_tree_model_node_get_first_child(adapter->priv->source, path);
if (first_child && e_tree_table_adapter_node_is_expanded (adapter, path)) {
row ++;
- if (row >= adapter->priv->n_map)
+ if (row > adapter->priv->n_map)
return -1;
return row;
} else
@@ -319,9 +319,11 @@ find_row_num(ETreeTableAdapter *etta, ETreePath path)
row = 0;
for (i = depth; i >= 0; i --) {
- while (row != -1 && sequence[i] != etta->priv->map_table[row]) {
+ while (row != -1 && row < etta->priv->n_map && sequence[i] != etta->priv->map_table[row]) {
row = find_next_node(etta, row);
}
+ if (row >= etta->priv->n_map)
+ break;
if (row == -1)
break;
if (i == 0)
@@ -330,6 +332,9 @@ find_row_num(ETreeTableAdapter *etta, ETreePath path)
}
g_free (sequence);
+ if (row >= etta->priv->n_map)
+ row = -1;
+
d(g_print("Didn't find last access %d. Setting to %d. (find_row_num)\n", etta->priv->last_access, row));
etta->priv->last_access = row;
return row;