[gnumeric] xlsx: simplify floating-point attribute code.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] xlsx: simplify floating-point attribute code.
- Date: Sat, 7 Mar 2015 17:08:42 +0000 (UTC)
commit 12199df0f4ca1ffb78340c1a5bcfe61f133966fe
Author: Morten Welinder <terra gnome org>
Date: Sat Mar 7 11:11:16 2015 -0500
xlsx: simplify floating-point attribute code.
plugins/excel/ChangeLog | 5 +++++
plugins/excel/xlsx-write-drawing.c | 17 ++++++++---------
2 files changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 0d56f30..49ba427 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-07 Morten Welinder <terra gnome org>
+
+ * xlsx-write-drawing.c (xlsx_write_chart_float): Drop def_val
+ argument.
+
2015-03-04 Morten Welinder <terra gnome org>
* xlsx-read-drawing.c (xlsx_create_axis_object): Handle log axis.
diff --git a/plugins/excel/xlsx-write-drawing.c b/plugins/excel/xlsx-write-drawing.c
index 96f5856..8f2e42f 100644
--- a/plugins/excel/xlsx-write-drawing.c
+++ b/plugins/excel/xlsx-write-drawing.c
@@ -60,11 +60,10 @@ xlsx_write_chart_uint (GsfXMLOut *xml, char const *name, int def_val, int val)
}
static void
-xlsx_write_chart_float (GsfXMLOut *xml, char const *name, double def_val, double val)
+xlsx_write_chart_float (GsfXMLOut *xml, char const *name, double val)
{
gsf_xml_out_start_element (xml, name);
- if (val != def_val)
- gsf_xml_out_add_float (xml, "val", val, -1);
+ gsf_xml_out_add_float (xml, "val", val, -1);
gsf_xml_out_end_element (xml);
}
@@ -680,15 +679,15 @@ xlsx_write_axis (XLSXWriteState *state, GsfXMLOut *xml, GogPlot *plot, GogAxis *
g_object_get (axis, "map-name", &map_name, NULL);
if (g_strcmp0 (map_name, "Log") == 0) {
double base = 10;
- xlsx_write_chart_float (xml, "c:logBase", go_nan, base);
+ xlsx_write_chart_float (xml, "c:logBase", base);
}
g_free (map_name);
xlsx_write_chart_cstr_unchecked (xml, "c:orientation",
gog_axis_is_inverted (axis)? "maxMin": "minMax");
d = gog_axis_get_entry (axis, GOG_AXIS_ELEM_MAX, &user_defined);
- if (user_defined) xlsx_write_chart_float (xml, "c:max", go_nan, d);
+ if (user_defined) xlsx_write_chart_float (xml, "c:max", d);
d = gog_axis_get_entry (axis, GOG_AXIS_ELEM_MIN, &user_defined);
- if (user_defined) xlsx_write_chart_float (xml, "c:min", go_nan, d);
+ if (user_defined) xlsx_write_chart_float (xml, "c:min", d);
gsf_xml_out_end_element (xml);
xlsx_write_chart_uint (xml, "c:delete", 1, 0);
@@ -761,15 +760,15 @@ xlsx_write_axis (XLSXWriteState *state, GsfXMLOut *xml, GogPlot *plot, GogAxis *
if (cross == 0.)
xlsx_write_chart_cstr_unchecked (xml, "c:crosses", "autoZero");
else
- xlsx_write_chart_float (xml, "c:crossesAt", 0., cross);
+ xlsx_write_chart_float (xml, "c:crossesAt", cross);
break;
}
}
d = gog_axis_get_entry (axis, GOG_AXIS_ELEM_MAJOR_TICK, &user_defined);
- if (user_defined && d > 0) xlsx_write_chart_float (xml, "c:majorUnit", go_nan, d);
+ if (user_defined && d > 0) xlsx_write_chart_float (xml, "c:majorUnit", d);
d = gog_axis_get_entry (axis, GOG_AXIS_ELEM_MINOR_TICK, &user_defined);
- if (user_defined && d > 0) xlsx_write_chart_float (xml, "c:minorUnit", go_nan, d);
+ if (user_defined && d > 0) xlsx_write_chart_float (xml, "c:minorUnit", d);
/* finished with axis */
gsf_xml_out_end_element (xml);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]