[g-a-devel]small gailcanvasitem patch



This fixes some small issues with gailcanvasitem's get_item_extents()
method.

ok to commit?

-dave




Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gail/ChangeLog,v
retrieving revision 1.397
diff -u -r1.397 ChangeLog
--- ChangeLog	12 Mar 2002 19:24:26 -0000	1.397
+++ ChangeLog	13 Mar 2002 01:55:10 -0000
@@ -1,4 +1,11 @@
 (top)
+2002-03-12  Dave Camp  <dave ximian com>
+
+	* gail/gailcanvasitem.c (get_item_extents): Use G_OBJECT_GET_CLASS
+	to get the class of the item.
+	(gail_canvas_item_get_extents): Check obj != NULL before
+	trying to cast it to GNOME_CANVAS_ITEM.
+
 2002-03-12  Federico Mena Quintero  <federico ximian com>
 
 	* gail/gailcanvasitem.c (get_item_extents): Compute the extents
Index: gail/gailcanvasitem.c
===================================================================
RCS file: /cvs/gnome/gail/gail/gailcanvasitem.c,v
retrieving revision 1.14
diff -u -r1.14 gailcanvasitem.c
--- gail/gailcanvasitem.c	12 Mar 2002 19:24:26 -0000	1.14
+++ gail/gailcanvasitem.c	13 Mar 2002 01:55:10 -0000
@@ -282,12 +282,13 @@
   atk_gobj = ATK_GOBJECT_ACCESSIBLE (component);
   obj = atk_gobject_accessible_get_object (atk_gobj);
 
-  /* Get the GnomeCanvasItem */
-  item = GNOME_CANVAS_ITEM (obj);
-  if (item == NULL)
+  if (obj == NULL) 
     /* item is defunct */
     return;
 
+  /* Get the GnomeCanvasItem */
+  item = GNOME_CANVAS_ITEM (obj);
+
   /* If this item has no parent canvas, something's broken */
   g_return_if_fail (GTK_IS_WIDGET (item->canvas));
 
@@ -370,8 +371,8 @@
 
   bx1 = by1 = bx2 = by2 = 0.0;
 
-  if (GNOME_CANVAS_ITEM_CLASS (item)->bounds)
-    (* GNOME_CANVAS_ITEM_CLASS (item)->bounds) (item, &bx1, &by1, &bx2, &by2);
+  if (GNOME_CANVAS_ITEM_CLASS (G_OBJECT_GET_CLASS (item))->bounds)
+    (* GNOME_CANVAS_ITEM_CLASS (G_OBJECT_GET_CLASS (item))->bounds) (item, &bx1, &by1, &bx2, &by2);
 
   /* Get the item coordinates -> canvas pixel coordinates affine */
 


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