Bug 488119 - critical warnings from gtk_tree_view_get_visible_range

2008-06-08  Kristian Rietveld  <kris@gtk.org>

	Bug 488119 - critical warnings from gtk_tree_view_get_visible_range

	* gtk/gtktreeview.c (gtk_tree_view_get_visible_range): only try to
	find path if we found valid nodes, return FALSE otherwise.  (Patch
	from Matthias Clasen).


svn path=/trunk/; revision=20333
This commit is contained in:
Kristian Rietveld 2008-06-08 12:47:15 +00:00 committed by Kristian Rietveld
parent e0ca75c120
commit 898fe0c82f
2 changed files with 21 additions and 4 deletions

View File

@ -1,3 +1,11 @@
2008-06-08 Kristian Rietveld <kris@gtk.org>
Bug 488119 - critical warnings from gtk_tree_view_get_visible_range
* gtk/gtktreeview.c (gtk_tree_view_get_visible_range): only try to
find path if we found valid nodes, return FALSE otherwise. (Patch
from Matthias Clasen).
2008-06-08 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkrecentmanager.c:

View File

@ -13237,18 +13237,24 @@ gtk_tree_view_get_visible_range (GtkTreeView *tree_view,
{
GtkRBTree *tree;
GtkRBNode *node;
gboolean retval;
g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), FALSE);
if (!tree_view->priv->tree)
return FALSE;
retval = TRUE;
if (start_path)
{
_gtk_rbtree_find_offset (tree_view->priv->tree,
TREE_WINDOW_Y_TO_RBTREE_Y (tree_view, 0),
&tree, &node);
*start_path = _gtk_tree_view_find_path (tree_view, tree, node);
if (node)
*start_path = _gtk_tree_view_find_path (tree_view, tree, node);
else
retval = FALSE;
}
if (end_path)
@ -13261,10 +13267,13 @@ gtk_tree_view_get_visible_range (GtkTreeView *tree_view,
y = TREE_WINDOW_Y_TO_RBTREE_Y (tree_view, tree_view->priv->vadjustment->page_size) - 1;
_gtk_rbtree_find_offset (tree_view->priv->tree, y, &tree, &node);
*end_path = _gtk_tree_view_find_path (tree_view, tree, node);
if (node)
*end_path = _gtk_tree_view_find_path (tree_view, tree, node);
else
retval = FALSE;
}
return TRUE;
return retval;
}
static void