[gnumeric] xlsx: resolve "auto" to "none" for markers when appropriate.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] xlsx: resolve "auto" to "none" for markers when appropriate.
- Date: Wed, 21 Jan 2015 18:00:41 +0000 (UTC)
commit f691a2b21ab97078bd3b5f41bc3d5efaddac408e
Author: Morten Welinder <terra gnome org>
Date: Wed Jan 21 12:59:16 2015 -0500
xlsx: resolve "auto" to "none" for markers when appropriate.
When we don't have markers by virtue of the plot not having them
as default, resolve to "none".
plugins/excel/xlsx-write-drawing.c | 26 +++++++++++++++++++-------
1 files changed, 19 insertions(+), 7 deletions(-)
---
diff --git a/plugins/excel/xlsx-write-drawing.c b/plugins/excel/xlsx-write-drawing.c
index 83071a1..7c613e6 100644
--- a/plugins/excel/xlsx-write-drawing.c
+++ b/plugins/excel/xlsx-write-drawing.c
@@ -129,7 +129,8 @@ xlsx_write_rgbarea (GsfXMLOut *xml, GOColor color)
}
static void
-xlsx_write_go_style (GsfXMLOut *xml, GOStyle *style)
+xlsx_write_go_style_full (GsfXMLOut *xml, GOStyle *style,
+ gboolean def_has_markers)
{
gsf_xml_out_start_element (xml, "c:spPr");
@@ -230,7 +231,7 @@ xlsx_write_go_style (GsfXMLOut *xml, GOStyle *style)
};
gboolean need_spPr;
GOMarkerShape s = style->marker.auto_shape
- ? GO_MARKER_MAX
+ ? (def_has_markers ? GO_MARKER_MAX : GO_MARKER_NONE)
: go_marker_get_shape (style->marker.mark);
gsf_xml_out_start_element (xml, "c:marker");
@@ -242,9 +243,10 @@ xlsx_write_go_style (GsfXMLOut *xml, GOStyle *style)
: "auto"));
/* We don't have an auto_size flag */
- if (TRUE)
- xlsx_write_chart_int (xml, "c:size", 5,
- go_marker_get_size (style->marker.mark));
+ if (TRUE) {
+ int def = 5, s = go_marker_get_size (style->marker.mark);
+ xlsx_write_chart_int (xml, "c:size", def, s);
+ }
need_spPr = (!style->marker.auto_fill_color ||
!style->marker.auto_outline_color);
@@ -273,6 +275,12 @@ xlsx_write_go_style (GsfXMLOut *xml, GOStyle *style)
}
static void
+xlsx_write_go_style (GsfXMLOut *xml, GOStyle *style)
+{
+ xlsx_write_go_style_full (xml, style, FALSE);
+}
+
+static void
xlsx_write_chart_text (XLSXWriteState *state, GsfXMLOut *xml,
GOData *data, GOStyledObject *so)
{
@@ -410,6 +418,7 @@ xlsx_write_one_plot (XLSXWriteState *state, GsfXMLOut *xml, GogObject const *cha
unsigned count;
gboolean use_xy = FALSE;
gboolean set_smooth = FALSE;
+ gboolean has_markers = FALSE;
g_object_get (G_OBJECT (plot),
"vary-style-by-element", &vary_by_element,
@@ -452,6 +461,9 @@ xlsx_write_one_plot (XLSXWriteState *state, GsfXMLOut *xml, GogObject const *cha
xlsx_write_plot_1_5_type (xml, plot, FALSE);
xlsx_write_chart_bool (xml, "c:varyColors", vary_by_element);
set_smooth = TRUE;
+ g_object_get (G_OBJECT (plot),
+ "default-style-has-markers", &has_markers,
+ NULL);
break;
case XLSX_PT_GOGPIEPLOT:
@@ -493,7 +505,7 @@ xlsx_write_one_plot (XLSXWriteState *state, GsfXMLOut *xml, GogObject const *cha
break;
case XLSX_PT_GOGXYPLOT: {
- gboolean has_lines, has_markers, use_splines;
+ gboolean has_lines, use_splines;
char const *style;
g_object_get (G_OBJECT (plot),
"default-style-has-lines", &has_lines,
@@ -533,7 +545,7 @@ xlsx_write_one_plot (XLSXWriteState *state, GsfXMLOut *xml, GogObject const *cha
xlsx_write_chart_int (xml, "c:order", -1, count);
xlsx_write_series_dim (state, xml, ser, "c:tx", GOG_MS_DIM_LABELS);
if (!vary_by_element) /* FIXME: we might loose some style elements */
- xlsx_write_go_style (xml, style);
+ xlsx_write_go_style_full (xml, style, has_markers);
children = gog_object_get_children (GOG_OBJECT (ser), NULL);
for (l = children; l; l = l->next) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]