From 08e4e25a0946da3b3c66b1634cc487b0f8cb0d7b Mon Sep 17 00:00:00 2001 From: Jean Brefort Date: Fri, 1 Jun 2007 06:04:51 +0000 Subject: [PATCH] don't delete a valid axis. 2007-06-01 Jean Brefort * ms-chart.c: don't delete a valid axis. svn path=/branches/gnumeric-1-6/; revision=15581 --- plugins/excel/ChangeLog | 4 ++++ plugins/excel/ms-chart.c | 30 +++++++++++++++++------------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog index a3eec531d..0a72f088f 100644 --- a/plugins/excel/ChangeLog +++ b/plugins/excel/ChangeLog @@ -1,3 +1,7 @@ +2007-06-01 Jean Brefort + + * ms-chart.c: don't delete a valid axis. + 2006-09-30 Jean Brefort * ms-chart.c: (end): Don't use auto_shape or auto_dash when plot has diff --git a/plugins/excel/ms-chart.c b/plugins/excel/ms-chart.c index 2f1b6684f..721da8097 100644 --- a/plugins/excel/ms-chart.c +++ b/plugins/excel/ms-chart.c @@ -105,6 +105,7 @@ typedef struct { GogPlot *plot; GogStyle *default_plot_style; GogObject *axis, *xaxis; + guint8 axislineflags; GogStyle *style; GogStyle *chartline_style[3]; GogStyle *dropbar_style; @@ -576,14 +577,21 @@ BC_R(axislineformat)(XLChartHandler const *handle, if (s->axis != NULL) switch (type) { case 0: - g_object_set (G_OBJECT (s->axis), - "style", s->style, - NULL); - /* deleted axis sets flag here, rather than in TICK */ - if (0 == (0x4 & GSF_LE_GET_GUINT16 (q->data+8))) + if (s->axislineflags == 8) { + /* axis has no ticks, it is a dummy axis, just delete it */ + gog_object_clear_parent (GOG_OBJECT (s->axis)); + g_object_unref (s->axis); + s->axis = NULL; + } else { g_object_set (G_OBJECT (s->axis), - "major-tick-labeled", FALSE, + "style", s->style, NULL); + /* deleted axis sets flag here, rather than in TICK */ + if (0 == (0x4 & GSF_LE_GET_GUINT16 (q->data+8))) + g_object_set (G_OBJECT (s->axis), + "major-tick-labeled", FALSE, + NULL); + } break; case 1: { GogObject *GridLine = GOG_OBJECT (g_object_new (GOG_GRID_LINE_TYPE, @@ -1276,13 +1284,9 @@ BC_R(lineformat)(XLChartHandler const *handle, else g_object_unref (s->style); s->style = NULL; - } else if (s->axis != NULL && flags == 8) { - /* axis has no ticks, it is a dummy axis, just delete it */ - gog_object_clear_parent (GOG_OBJECT (s->axis)); - g_object_unref (s->axis); - s->axis = NULL; - } - + } else if (s->axis != NULL + s->axislineflags = flags; + return FALSE; } -- GitLab