gnumeric r16413 - in branches/gnumeric-1-8: . plugins/excel



Author: mortenw
Date: Wed Feb 27 16:30:14 2008
New Revision: 16413
URL: http://svn.gnome.org/viewvc/gnumeric?rev=16413&view=rev

Log:
2008-02-27  Morten Welinder  <terra gnome org>

	* ms-chart.c (set_radial_axes): If clearing the parent fails, the
	ref-count is not as expected to stop messing with the object.
	Fixes #518939.  Mostly.



Modified:
   branches/gnumeric-1-8/NEWS
   branches/gnumeric-1-8/plugins/excel/ChangeLog
   branches/gnumeric-1-8/plugins/excel/ms-chart.c

Modified: branches/gnumeric-1-8/NEWS
==============================================================================
--- branches/gnumeric-1-8/NEWS	(original)
+++ branches/gnumeric-1-8/NEWS	Wed Feb 27 16:30:14 2008
@@ -14,7 +14,7 @@
 	  [#513317] [#513361] [#513364] [#513551] [#513605] [#513608] [#513790]
 	  [#513787] [#513835] [#513963] [#514229] [#514230] [#514295] [#514435]
 	  [#514436] [#514437] [#514506] [#514510] [#514630] [#514637] [#515155]
-	  [#515269] [#515275] [#515335] [#515336] [#515339] [#517106].
+	  [#515269] [#515275] [#515335] [#515336] [#515339] [#517106] [#518939]
 	* Fix non-ascii export problem.  [#511135]
 	* Band-aid evaluation problem with broken xls.  [#513559]
 	* Fix circular array formula problem.

Modified: branches/gnumeric-1-8/plugins/excel/ms-chart.c
==============================================================================
--- branches/gnumeric-1-8/plugins/excel/ms-chart.c	(original)
+++ branches/gnumeric-1-8/plugins/excel/ms-chart.c	Wed Feb 27 16:30:14 2008
@@ -1643,25 +1643,32 @@
 set_radial_axes (XLChartReadState *s)
 {
 	GSList *l, *cur;
-	/* Change axes types */
-	l = cur = gog_chart_get_axes (s->chart, GOG_AXIS_X);
-	while (cur) {
-		gog_object_clear_parent (GOG_OBJECT (cur->data));
-		g_object_set (G_OBJECT (cur->data), "type",
-			GOG_AXIS_CIRCULAR, NULL);
+
+	l = gog_chart_get_axes (s->chart, GOG_AXIS_X);
+	for (cur = l; cur; cur = cur->next) {
+		GogObject *axis = cur->data;
+
+		if (!gog_object_clear_parent (axis))
+			continue;
+
+		g_object_set (G_OBJECT (axis), "type",
+			      GOG_AXIS_CIRCULAR, NULL);
 		gog_object_add_by_name (GOG_OBJECT (s->chart),
-			"Circular-Axis", GOG_OBJECT (cur->data));
-		cur = cur->next;
+					"Circular-Axis", axis);
 	}
 	g_slist_free (l);
-	l = cur = gog_chart_get_axes (s->chart, GOG_AXIS_Y);
-	while (cur) {
-		gog_object_clear_parent (GOG_OBJECT (cur->data));
-		g_object_set (G_OBJECT (cur->data), "type",
-			GOG_AXIS_RADIAL, NULL);
+
+	l = gog_chart_get_axes (s->chart, GOG_AXIS_Y);
+	for (cur = l; cur; cur = cur->next) {
+		GogObject *axis = cur->data;
+
+		if (!gog_object_clear_parent (axis))
+			continue;
+
+		g_object_set (G_OBJECT (axis), "type",
+			      GOG_AXIS_RADIAL, NULL);
 		gog_object_add_by_name (GOG_OBJECT (s->chart),
-			"Radial-Axis", GOG_OBJECT (cur->data));
-		cur = cur->next;
+					"Radial-Axis", axis);
 	}
 	g_slist_free (l);
 }



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