gnumeric r16420 - in branches/gnumeric-1-8: . plugins/excel
- From: mortenw svn gnome org
- To: svn-commits-list gnome org
- Subject: gnumeric r16420 - in branches/gnumeric-1-8: . plugins/excel
- Date: Fri, 29 Feb 2008 14:31:51 +0000 (GMT)
Author: mortenw
Date: Fri Feb 29 14:31:51 2008
New Revision: 16420
URL: http://svn.gnome.org/viewvc/gnumeric?rev=16420&view=rev
Log:
2008-02-29 Jean Brefort <jean brefort normalesup org>
* ms-chart.c (BC_R(end)): Drop axes that the plot cannot handle.
Fixes a number of criticals from #518939.
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 Fri Feb 29 14:31:51 2008
@@ -5,7 +5,7 @@
Jean:
* Fix corrupted-xls-file problems. [#514513] [#515343] [#515873]
- [#515876]
+ [#515876] [#518939]
Morten:
* Fix loading of solver constraints.
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 Fri Feb 29 14:31:51 2008
@@ -1648,7 +1648,9 @@
for (cur = l; cur; cur = cur->next) {
GogObject *axis = cur->data;
- if (!gog_object_clear_parent (axis))
+ if (gog_object_is_deletable (axis))
+ gog_object_clear_parent (axis);
+ else
continue;
g_object_set (G_OBJECT (axis), "type",
@@ -1662,7 +1664,9 @@
for (cur = l; cur; cur = cur->next) {
GogObject *axis = cur->data;
- if (!gog_object_clear_parent (axis))
+ if (gog_object_is_deletable (axis))
+ gog_object_clear_parent (axis);
+ else
continue;
g_object_set (G_OBJECT (axis), "type",
@@ -1678,6 +1682,7 @@
XLChartReadState *s, BiffQuery *q)
{
g_return_val_if_fail (s->plot == NULL, TRUE);
+
s->plot = (GogPlot*) gog_plot_new_by_name ("GogRadarPlot");
/* XL defaults to having markers and does not emit a style record
* to define a marker in the default case. */
@@ -2698,9 +2703,48 @@
g_return_val_if_fail (s->plot != NULL, TRUE);
+ /*
+ * Check whether the chart already contains a plot and, if so,
+ * if axis sets are compatible
+ */
+ {
+ GogAxisSet axis_set = gog_chart_get_axis_set (s->chart);
+ GogAxisSet plot_axis_set = G_TYPE_INSTANCE_GET_CLASS ((s->plot), GOG_PLOT_TYPE, GogPlotClass)->axis_set;
+
+ if (axis_set != GOG_AXIS_SET_UNKNOWN &&
+ (axis_set & GOG_AXIS_SET_FUNDAMENTAL & ~plot_axis_set)) {
+ GogAxisType i;
+ GogAxisSet j;
+
+ g_object_unref (s->plot);
+ s->plot = NULL;
+ if (s->style) {
+ g_object_unref (s->style);
+ s->style = NULL;
+ }
+
+ /* Now remove all unwanted axes. */
+ for (i = 0, j = 1;
+ i < GOG_AXIS_VIRTUAL;
+ i++, j <<= 1) {
+ if ((j & axis_set) == 0) {
+ GSList *l = gog_chart_get_axes (s->chart, i), *cur;
+ for (cur = l; cur; cur = cur->next) {
+ GogObject *axis = cur->data;
+ gog_object_clear_parent (axis);
+ g_object_unref (axis);
+ }
+ g_slist_free (l);
+ }
+
+ }
+ return TRUE;
+ }
+ }
+
/* Add _before_ setting styles so theme does not override */
gog_object_add_by_name (GOG_OBJECT (s->chart),
- "Plot", GOG_OBJECT (s->plot));
+ "Plot", GOG_OBJECT (s->plot));
if (s->default_plot_style != NULL) {
char const *type = G_OBJECT_TYPE_NAME (s->plot);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]