diff options
author | Carlos Garcia Campos <carlosgc@gnome.org> | 2008-08-17 14:41:47 (GMT) |
---|---|---|
committer | Carlos Garcia Campos <carlosgc@src.gnome.org> | 2008-08-17 14:41:47 (GMT) |
commit | e564142f4d25d983db3ad20ece131c531e418bc5 (patch) | |
tree | 5121f5afc44b742bfa757e0c63a441794aebbf88 | |
parent | acda93972108b165270d6500ca989c3eb30934b9 (diff) |
Do not crash when adjustment page size is 0. Fixes bug #547440.
2008-08-17 Carlos Garcia Campos <carlosgc@gnome.org>
* shell/ev-sidebar-thumbnails.c: (adjustment_changed_cb):
Do not crash when adjustment page size is 0. Fixes bug #547440.
svn path=/trunk/; revision=3109
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | shell/ev-sidebar-thumbnails.c | 17 |
2 files changed, 16 insertions, 7 deletions
@@ -1,3 +1,9 @@ +2008-08-17 Carlos Garcia Campos <carlosgc@gnome.org> + + * shell/ev-sidebar-thumbnails.c: (adjustment_changed_cb): + + Do not crash when adjustment page size is 0. Fixes bug #547440. + 2008-08-11 Carlos Garcia Campos <carlosgc@gnome.org> * cut-n-paste/evmountoperation/ev-mount-operation.c: diff --git a/shell/ev-sidebar-thumbnails.c b/shell/ev-sidebar-thumbnails.c index 0a97e5f..2850514 100644 --- a/shell/ev-sidebar-thumbnails.c +++ b/shell/ev-sidebar-thumbnails.c @@ -326,18 +326,21 @@ adjustment_changed_cb (EvSidebarThumbnails *sidebar_thumbnails) /* Widget is not currently visible */ if (!GTK_WIDGET_MAPPED (sidebar_thumbnails)) return; + + if (priv->vadjustment->page_size == 0) + return; if (priv->tree_view) { if (! GTK_WIDGET_REALIZED (priv->tree_view)) return; #if GTK_CHECK_VERSION (2, 11, 3) - gtk_tree_view_convert_widget_to_bin_window_coords (GTK_TREE_VIEW (priv->tree_view), - 0, (int) priv->vadjustment->value, - NULL, &wy1); - gtk_tree_view_convert_widget_to_bin_window_coords (GTK_TREE_VIEW (priv->tree_view), - 0, (int) (priv->vadjustment->value + priv->vadjustment->page_size), - NULL, &wy2); + gtk_tree_view_convert_tree_to_bin_window_coords (GTK_TREE_VIEW (priv->tree_view), + 0, (int) priv->vadjustment->value, + NULL, &wy1); + gtk_tree_view_convert_tree_to_bin_window_coords (GTK_TREE_VIEW (priv->tree_view), + 0, (int) (priv->vadjustment->value + priv->vadjustment->page_size), + NULL, &wy2); #else gtk_tree_view_tree_to_widget_coords (GTK_TREE_VIEW (priv->tree_view), 0, (int) priv->vadjustment->value, @@ -346,7 +349,7 @@ adjustment_changed_cb (EvSidebarThumbnails *sidebar_thumbnails) 0, (int) (priv->vadjustment->value + priv->vadjustment->page_size), NULL, &wy2); #endif /* GTK_CHECK_VERSION (2, 11, 3) */ - + gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (priv->tree_view), 1, wy1 + 1, &path, NULL, NULL, NULL); |