[gnumeric] xlsx: make sure minorUnit and majorUnit are valid.



commit 4b903b7599164af9320cf561aa15739c4c4b3a8e
Author: Morten Welinder <terra gnome org>
Date:   Tue Jan 27 15:37:24 2015 -0500

    xlsx: make sure minorUnit and majorUnit are valid.

 plugins/excel/xlsx-write-drawing.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/plugins/excel/xlsx-write-drawing.c b/plugins/excel/xlsx-write-drawing.c
index e3f9475..61e1426 100644
--- a/plugins/excel/xlsx-write-drawing.c
+++ b/plugins/excel/xlsx-write-drawing.c
@@ -477,9 +477,9 @@ xlsx_write_axis (XLSXWriteState *state, GsfXMLOut *xml, GogAxis *axis, GogAxisTy
        }
 
        d = gog_axis_get_entry (axis, GOG_AXIS_ELEM_MAJOR_TICK, &user_defined);
-       if (user_defined) xlsx_write_chart_float (xml, "c:majorUnit", go_nan, d);
+       if (user_defined && d > 0) xlsx_write_chart_float (xml, "c:majorUnit", go_nan, d);
        d = gog_axis_get_entry (axis, GOG_AXIS_ELEM_MINOR_TICK, &user_defined);
-       if (user_defined) xlsx_write_chart_float (xml, "c:minorUnit", go_nan, d);
+       if (user_defined && d > 0) xlsx_write_chart_float (xml, "c:minorUnit", go_nan, d);
 
        /* finished with axis */
        gsf_xml_out_end_element (xml);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]