Commit 18dfabc1 authored by Kristian Rietveld's avatar Kristian Rietveld Committed by Kristian Rietveld

check the return value of _gtk_tree_view_find_node and return if it's

Mon Apr  8 20:28:54 2002  Kristian Rietveld  <kris@gtk.org>

        * gtk/gtktreeselection.c (gtk_tree_selection_select_path),
        (gtk_tree_selection_unselect_path),
        (gtk_tree_selection_path_is_selected): check the return value of
        _gtk_tree_view_find_node and return if it's TRUE. This makes those
        functions work somewhat saner on non-expanded trees.
parent 673e14fe
Mon Apr 8 20:28:54 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeselection.c (gtk_tree_selection_select_path),
(gtk_tree_selection_unselect_path),
(gtk_tree_selection_path_is_selected): check the return value of
_gtk_tree_view_find_node and return if it's TRUE. This makes those
functions work somewhat saner on non-expanded trees.
Fri Apr 5 18:28:56 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeselection.c (gtk_tree_selection_set_mode): free
......
Mon Apr 8 20:28:54 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeselection.c (gtk_tree_selection_select_path),
(gtk_tree_selection_unselect_path),
(gtk_tree_selection_path_is_selected): check the return value of
_gtk_tree_view_find_node and return if it's TRUE. This makes those
functions work somewhat saner on non-expanded trees.
Fri Apr 5 18:28:56 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeselection.c (gtk_tree_selection_set_mode): free
......
Mon Apr 8 20:28:54 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeselection.c (gtk_tree_selection_select_path),
(gtk_tree_selection_unselect_path),
(gtk_tree_selection_path_is_selected): check the return value of
_gtk_tree_view_find_node and return if it's TRUE. This makes those
functions work somewhat saner on non-expanded trees.
Fri Apr 5 18:28:56 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeselection.c (gtk_tree_selection_set_mode): free
......
Mon Apr 8 20:28:54 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeselection.c (gtk_tree_selection_select_path),
(gtk_tree_selection_unselect_path),
(gtk_tree_selection_path_is_selected): check the return value of
_gtk_tree_view_find_node and return if it's TRUE. This makes those
functions work somewhat saner on non-expanded trees.
Fri Apr 5 18:28:56 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeselection.c (gtk_tree_selection_set_mode): free
......
Mon Apr 8 20:28:54 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeselection.c (gtk_tree_selection_select_path),
(gtk_tree_selection_unselect_path),
(gtk_tree_selection_path_is_selected): check the return value of
_gtk_tree_view_find_node and return if it's TRUE. This makes those
functions work somewhat saner on non-expanded trees.
Fri Apr 5 18:28:56 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeselection.c (gtk_tree_selection_set_mode): free
......
Mon Apr 8 20:28:54 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeselection.c (gtk_tree_selection_select_path),
(gtk_tree_selection_unselect_path),
(gtk_tree_selection_path_is_selected): check the return value of
_gtk_tree_view_find_node and return if it's TRUE. This makes those
functions work somewhat saner on non-expanded trees.
Fri Apr 5 18:28:56 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeselection.c (gtk_tree_selection_set_mode): free
......
......@@ -527,17 +527,19 @@ gtk_tree_selection_select_path (GtkTreeSelection *selection,
GtkRBNode *node;
GtkRBTree *tree;
GdkModifierType state = 0;
gboolean ret;
g_return_if_fail (GTK_IS_TREE_SELECTION (selection));
g_return_if_fail (selection->tree_view != NULL);
g_return_if_fail (path != NULL);
_gtk_tree_view_find_node (selection->tree_view,
path,
&tree,
&node);
ret = _gtk_tree_view_find_node (selection->tree_view,
path,
&tree,
&node);
if (node == NULL || GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED))
if (node == NULL || GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED) ||
ret == TRUE)
return;
if (selection->type == GTK_SELECTION_MULTIPLE)
......@@ -563,17 +565,19 @@ gtk_tree_selection_unselect_path (GtkTreeSelection *selection,
{
GtkRBNode *node;
GtkRBTree *tree;
gboolean ret;
g_return_if_fail (GTK_IS_TREE_SELECTION (selection));
g_return_if_fail (selection->tree_view != NULL);
g_return_if_fail (path != NULL);
_gtk_tree_view_find_node (selection->tree_view,
path,
&tree,
&node);
ret = _gtk_tree_view_find_node (selection->tree_view,
path,
&tree,
&node);
if (node == NULL || !GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED))
if (node == NULL || !GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED) ||
ret == TRUE)
return;
_gtk_tree_selection_internal_select_node (selection,
......@@ -656,18 +660,20 @@ gtk_tree_selection_path_is_selected (GtkTreeSelection *selection,
{
GtkRBNode *node;
GtkRBTree *tree;
gboolean ret;
g_return_val_if_fail (GTK_IS_TREE_SELECTION (selection), FALSE);
g_return_val_if_fail (path != NULL, FALSE);
g_return_val_if_fail (selection->tree_view != NULL, FALSE);
g_return_val_if_fail (selection->tree_view->priv->model != NULL, FALSE);
_gtk_tree_view_find_node (selection->tree_view,
path,
&tree,
&node);
ret = _gtk_tree_view_find_node (selection->tree_view,
path,
&tree,
&node);
if ((node == NULL) || !GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED))
if ((node == NULL) || !GTK_RBNODE_FLAG_SET (node, GTK_RBNODE_IS_SELECTED) ||
ret == TRUE)
return FALSE;
return TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment