goocanvas r8 - in trunk: . src



Author: damon
Date: Tue Jun 24 09:28:57 2008
New Revision: 8
URL: http://svn.gnome.org/viewvc/goocanvas?rev=8&view=rev

Log:
2008-06-24  Damon Chaplin  <damon gnome org>

    * src/goocanvasgroup.c (goo_canvas_group_get_child)
    (goo_canvas_group_model_get_child): return NULL if child_num is out
    of range. #535150

    * src/goocanvasitemmodel.c (goo_canvas_item_model_get_child): 
    * src/goocanvasitem.c (goo_canvas_item_get_child): updated docs.



Modified:
   trunk/ChangeLog
   trunk/src/goocanvasgroup.c
   trunk/src/goocanvasitem.c
   trunk/src/goocanvasitemmodel.c

Modified: trunk/src/goocanvasgroup.c
==============================================================================
--- trunk/src/goocanvasgroup.c	(original)
+++ trunk/src/goocanvasgroup.c	Tue Jun 24 09:28:57 2008
@@ -238,7 +238,9 @@
 {
   GooCanvasGroup *group = (GooCanvasGroup*) item;
 
-  return group->items->pdata[child_num];
+  if (child_num < group->items->len)
+    return group->items->pdata[child_num];
+  return NULL;
 }
 
 
@@ -742,7 +744,9 @@
 {
   GooCanvasGroupModel *gmodel = (GooCanvasGroupModel*) model;
 
-  return gmodel->children->pdata[child_num];
+  if (child_num < gmodel->children->len)
+    return gmodel->children->pdata[child_num];
+  return NULL;
 }
 
 

Modified: trunk/src/goocanvasitem.c
==============================================================================
--- trunk/src/goocanvasitem.c	(original)
+++ trunk/src/goocanvasitem.c	Tue Jun 24 09:28:57 2008
@@ -622,7 +622,8 @@
  * 
  * Gets the child item at the given stack position.
  * 
- * Returns: the child item at the given stack position.
+ * Returns: the child item at the given stack position, or %NULL if @child_num
+ * is out of range.
  **/
 GooCanvasItem*
 goo_canvas_item_get_child (GooCanvasItem       *item,

Modified: trunk/src/goocanvasitemmodel.c
==============================================================================
--- trunk/src/goocanvasitemmodel.c	(original)
+++ trunk/src/goocanvasitemmodel.c	Tue Jun 24 09:28:57 2008
@@ -395,7 +395,8 @@
  * 
  * Gets the child at the given stack position.
  * 
- * Returns: the child at the given stack position.
+ * Returns: the child at the given stack position, or %NULL if @child_num
+ * is out of range.
  **/
 GooCanvasItemModel*
 goo_canvas_item_model_get_child (GooCanvasItemModel  *model,



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