Commit 08e4e25a authored by Jean Bréfort's avatar Jean Bréfort Committed by Jean Bréfort

don't delete a valid axis.

2007-06-01  Jean Brefort  <jean.brefort@normalesup.org>

	* ms-chart.c: don't delete a valid axis.


svn path=/branches/gnumeric-1-6/; revision=15581
parent 75b04ea7
2007-06-01 Jean Brefort <jean.brefort@normalesup.org>
* ms-chart.c: don't delete a valid axis.
2006-09-30 Jean Brefort <jean.brefort@normalesup.org> 2006-09-30 Jean Brefort <jean.brefort@normalesup.org>
* ms-chart.c: (end): Don't use auto_shape or auto_dash when plot has * ms-chart.c: (end): Don't use auto_shape or auto_dash when plot has
......
...@@ -105,6 +105,7 @@ typedef struct { ...@@ -105,6 +105,7 @@ typedef struct {
GogPlot *plot; GogPlot *plot;
GogStyle *default_plot_style; GogStyle *default_plot_style;
GogObject *axis, *xaxis; GogObject *axis, *xaxis;
guint8 axislineflags;
GogStyle *style; GogStyle *style;
GogStyle *chartline_style[3]; GogStyle *chartline_style[3];
GogStyle *dropbar_style; GogStyle *dropbar_style;
...@@ -576,14 +577,21 @@ BC_R(axislineformat)(XLChartHandler const *handle, ...@@ -576,14 +577,21 @@ BC_R(axislineformat)(XLChartHandler const *handle,
if (s->axis != NULL) if (s->axis != NULL)
switch (type) { switch (type) {
case 0: case 0:
g_object_set (G_OBJECT (s->axis), if (s->axislineflags == 8) {
"style", s->style, /* axis has no ticks, it is a dummy axis, just delete it */
NULL); gog_object_clear_parent (GOG_OBJECT (s->axis));
/* deleted axis sets flag here, rather than in TICK */ g_object_unref (s->axis);
if (0 == (0x4 & GSF_LE_GET_GUINT16 (q->data+8))) s->axis = NULL;
} else {
g_object_set (G_OBJECT (s->axis), g_object_set (G_OBJECT (s->axis),
"major-tick-labeled", FALSE, "style", s->style,
NULL); 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; break;
case 1: { case 1: {
GogObject *GridLine = GOG_OBJECT (g_object_new (GOG_GRID_LINE_TYPE, GogObject *GridLine = GOG_OBJECT (g_object_new (GOG_GRID_LINE_TYPE,
...@@ -1276,13 +1284,9 @@ BC_R(lineformat)(XLChartHandler const *handle, ...@@ -1276,13 +1284,9 @@ BC_R(lineformat)(XLChartHandler const *handle,
else else
g_object_unref (s->style); g_object_unref (s->style);
s->style = NULL; s->style = NULL;
} else if (s->axis != NULL && flags == 8) { } else if (s->axis != NULL
/* axis has no ticks, it is a dummy axis, just delete it */ s->axislineflags = flags;
gog_object_clear_parent (GOG_OBJECT (s->axis));
g_object_unref (s->axis);
s->axis = NULL;
}
return FALSE; return FALSE;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment