diff options
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/table/e-tree-selection-model.c | 2 | ||||
-rw-r--r-- | widgets/table/e-tree-table-adapter.c | 9 |
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) |