Commit 898fe0c8 authored by Kristian Rietveld's avatar Kristian Rietveld Committed by Kristian Rietveld

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
parent e0ca75c1
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:
......
......@@ -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
......
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