Index: plugins/excel/ms-chart.c
===================================================================
--- plugins/excel/ms-chart.c	(révision 16498)
+++ plugins/excel/ms-chart.c	(copie de travail)
@@ -4090,16 +4090,17 @@
 	GnmValue const *value = NULL;
 
 	if (dim != NULL) {
-		texpr = gnm_go_data_get_expr (dim);
-		if ((value = gnm_expr_top_get_range (texpr)) != NULL) {
-			GType const t = G_OBJECT_TYPE (dim);
-			value_release ((GnmValue*) value);
-			value = NULL;
-			/* the following condition should always be true */
-			if (t == GNM_GO_DATA_SCALAR_TYPE ||
-			    t == GNM_GO_DATA_VECTOR_TYPE)
+		GType const t = G_OBJECT_TYPE (dim);
+		if (t == GNM_GO_DATA_SCALAR_TYPE ||
+		    t == GNM_GO_DATA_VECTOR_TYPE) {
+			texpr = gnm_go_data_get_expr (dim);
+			if ((value = gnm_expr_top_get_range (texpr)) != NULL) {
+				value_release ((GnmValue*) value);
+				value = NULL;
 				ref_type = 2;
-		} else if ((value = gnm_expr_top_get_constant (texpr)))
+			} else if ((value = gnm_expr_top_get_constant (texpr)))
+				ref_type = 1;
+		} else
 			ref_type = 1;
 	}
 	ms_biff_put_var_next (s->bp, BIFF_CHART_ai);
@@ -4120,8 +4121,8 @@
 		ms_biff_put_var_seekto (s->bp, 6);
 		GSF_LE_SET_GUINT16 (lendat, len);
 		ms_biff_put_var_write (s->bp, lendat, 2);
-	} else if (ref_type == 1 && value) {
-		if (n) {
+	} else if (ref_type == 1) {
+		if (n && value) {
 			XLValue *xlval = g_new0 (XLValue, 1);
 			xlval->series = s->cur_series;
 			xlval->value = value;
@@ -4129,14 +4130,15 @@
 		} else {
 			guint dat[2];
 			char *str = (NULL != value && VALUE_IS_STRING (value))
-				? value_get_as_string (value) : go_data_as_str (dim);
-
-			ms_biff_put_commit (s->bp);
-			ms_biff_put_var_next (s->bp, BIFF_CHART_seriestext);
-			GSF_LE_SET_GUINT16 (dat, 0);
-			ms_biff_put_var_write  (s->bp, (guint8*) dat, 2);
-			excel_write_string (s->bp, STR_ONE_BYTE_LENGTH, str);
-			g_free (str);
+				? value_get_as_string (value) : ((dim)? go_data_as_str (dim): NULL);
+			if (str) {
+				ms_biff_put_commit (s->bp);
+				ms_biff_put_var_next (s->bp, BIFF_CHART_seriestext);
+				GSF_LE_SET_GUINT16 (dat, 0);
+				ms_biff_put_var_write  (s->bp, (guint8*) dat, 2);
+				excel_write_string (s->bp, STR_ONE_BYTE_LENGTH, str);
+				g_free (str);
+			}
 		}
 	}
 
