Commit 1090eba9 authored by Matthias Clasen's avatar Matthias Clasen

a11y: don't return random numbers

Return 0 for the image size if we don't have a pixbuf to measure.
parent 006d4636
......@@ -129,6 +129,9 @@ gtk_image_cell_accessible_get_image_size (AtkImage *image,
GtkCellRenderer *cell_renderer;
GdkPixbuf *pixbuf = NULL;
*width = 0;
*height = 0;
cell_renderer = GTK_RENDERER_CELL_ACCESSIBLE (cell)->renderer;
g_object_get (GTK_CELL_RENDERER_PIXBUF (cell_renderer),
"pixbuf", &pixbuf,
......
......@@ -7316,6 +7316,9 @@ gtk_icon_view_item_accessible_get_image_size (AtkImage *image,
if (atk_state_set_contains_state (item->state_set, ATK_STATE_DEFUNCT))
return;
*width = 0;
*height = 0;
if (get_pixbuf_box (GTK_ICON_VIEW (item->widget), item->item, &box))
{
*width = box.width;
......
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