[gtk+/quartz-integration: 19/35] a11y: don't return random numbers



commit 18482d2e71526c8c2e40e7fce85f401d7b5863ba
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Aug 29 10:50:01 2011 -0400

    a11y: don't return random numbers
    
    Return 0 for the image size if we don't have a pixbuf to measure.

 gtk/a11y/gtkimagecellaccessible.c |    3 +++
 gtk/gtkiconview.c                 |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gtk/a11y/gtkimagecellaccessible.c b/gtk/a11y/gtkimagecellaccessible.c
index 4b35660..1db1470 100644
--- a/gtk/a11y/gtkimagecellaccessible.c
+++ b/gtk/a11y/gtkimagecellaccessible.c
@@ -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,
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index 6214706..a252e0f 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -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;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]