diff options
author | Christopher James Lahey <clahey@ximian.com> | 2001-04-04 18:59:44 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2001-04-04 18:59:44 +0800 |
commit | ac19d5492f290cc7f41e81dc6ff5873fc644f18f (patch) | |
tree | a10bf0789d1e71d9c2b49ef9a141d772e3f16c2c /widgets/table | |
parent | 9f5ae7c90177876baeb5f4ef57ac225bdd3adba5 (diff) | |
download | gsoc2013-evolution-ac19d5492f290cc7f41e81dc6ff5873fc644f18f.tar.gz gsoc2013-evolution-ac19d5492f290cc7f41e81dc6ff5873fc644f18f.tar.zst gsoc2013-evolution-ac19d5492f290cc7f41e81dc6ff5873fc644f18f.zip |
Made this work properly for models with 0 rows in the tree table adapter.
2001-04-04 Christopher James Lahey <clahey@ximian.com>
* e-tree-selection-model.c: Made this work properly for models
with 0 rows in the tree table adapter.
svn path=/trunk/; revision=9173
Diffstat (limited to 'widgets/table')
-rw-r--r-- | widgets/table/e-tree-selection-model.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/widgets/table/e-tree-selection-model.c b/widgets/table/e-tree-selection-model.c index d8eeb3f083..1854010fd7 100644 --- a/widgets/table/e-tree-selection-model.c +++ b/widgets/table/e-tree-selection-model.c @@ -123,6 +123,9 @@ etsm_node_at_row(ETreeSelectionModel *etsm, int row) { ETreePath path; + if (!(row >= 0 && row < e_table_model_row_count(E_TABLE_MODEL(etsm->priv->etta)))) + return NULL; + path = e_tree_table_adapter_node_at_row(etsm->priv->etta, row); if (path) @@ -673,6 +676,10 @@ etsm_is_row_selected (ESelectionModel *selection, gboolean ret_val; + g_return_val_if_fail(row < e_table_model_row_count(E_TABLE_MODEL(etsm->priv->etta)), FALSE); + g_return_val_if_fail(row >= 0, FALSE); + g_return_val_if_fail(selection != NULL, FALSE); + path = e_tree_table_adapter_node_at_row(etsm->priv->etta, row); selection_node = etsm_recurse_is_path_selected (selection, path, &ret_val); @@ -856,7 +863,13 @@ etsm_change_one_row(ESelectionModel *selection, int row, gboolean grow) { ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL(selection); ETreeSelectionModelNode *node; - ETreePath path = e_tree_table_adapter_node_at_row(etsm->priv->etta, row); + ETreePath path; + + g_return_if_fail(row < e_table_model_row_count(E_TABLE_MODEL(etsm->priv->etta))); + g_return_if_fail(row >= 0); + g_return_if_fail(selection != NULL); + + path = e_tree_table_adapter_node_at_row(etsm->priv->etta, row); if (!path) return; |