[goffice] Canvas: fix realize/unrealize problems. [#593593]



commit 8ca2760cbefcba33a41428123d038a36a00ba07f
Author: Morten Welinder <terra gnome org>
Date:   Sun Aug 30 19:27:42 2009 -0400

    Canvas: fix realize/unrealize problems.  [#593593]

 ChangeLog                  |    7 +++++++
 NEWS                       |    3 +++
 goffice/canvas/goc-group.c |    8 ++++----
 goffice/canvas/goc-item.c  |    1 +
 4 files changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 741a9fc..e3251cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-08-30  Morten Welinder  <terra gnome org>
+
+	* goffice/canvas/goc-item.c (goc_item_new): Keep track of realize.
+
+	* goffice/canvas/goc-group.c (goc_group_realize,
+	goc_group_unrealize): Set the right ->realized.
+
 2009-08-30  Morten Welinder <terra gnome org>
 
 	* configure.in: Post-release bump.
diff --git a/NEWS b/NEWS
index a015a24..8f2ca5d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 goffice 0.7.11:
 
+Morten:
+	* Fix canvas item realize/unrealize problems.  [#593593]
+
 --------------------------------------------------------------------------
 goffice 0.7.10:
 
diff --git a/goffice/canvas/goc-group.c b/goffice/canvas/goc-group.c
index 8a52e35..5fd1ec3 100644
--- a/goffice/canvas/goc-group.c
+++ b/goffice/canvas/goc-group.c
@@ -180,10 +180,10 @@ goc_group_realize (GocItem *item)
 	for (l = g_list_first (group->children); l; l = g_list_next (l)) {
 		GocItem *child = GOC_ITEM (l->data);
 		if (!child->realized) {
-			klass = GOC_ITEM_GET_CLASS (l->data);
+			klass = GOC_ITEM_GET_CLASS (child);
 			if (klass->realize)
-				klass->realize (GOC_ITEM (l->data));
-			item->realized = TRUE;
+				klass->realize (child);
+			child->realized = TRUE;
 		}
 	}
 }
@@ -200,7 +200,7 @@ goc_group_unrealize (GocItem *item)
 			klass = GOC_ITEM_GET_CLASS (child);
 			if (klass->unrealize)
 				klass->unrealize (child);
-			item->realized = FALSE;
+			child->realized = FALSE;
 		}
 	}
 }
diff --git a/goffice/canvas/goc-item.c b/goffice/canvas/goc-item.c
index fafb716..adb66ec 100644
--- a/goffice/canvas/goc-item.c
+++ b/goffice/canvas/goc-item.c
@@ -143,6 +143,7 @@ goc_item_new (GocGroup *group, GType type, const gchar *first_arg_name, ...)
 		GocItemClass *klass = GOC_ITEM_GET_CLASS (item);
 		if (klass->realize)
 			klass->realize (item);
+		item->realized = TRUE;
 	}
 
 	return item;



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