[gnumeric] xml: use new go_xml_out_add_double



commit 6ddaaf92a07966a9a3ad1bd902c24973ad3c7ee6
Author: Morten Welinder <terra gnome org>
Date:   Sat Mar 7 12:06:26 2015 -0500

    xml: use new go_xml_out_add_double

 ChangeLog                             |   11 ++++++++
 configure.ac                          |    2 +-
 plugins/excel/ChangeLog               |    7 +++++
 plugins/excel/xlsx-write-docprops.c   |   14 ++++------
 plugins/excel/xlsx-write-drawing.c    |   14 +++++-----
 plugins/excel/xlsx-write-pivot.c      |   12 ++++----
 plugins/excel/xlsx-write.c            |   33 ++++++++++++-------------
 plugins/openoffice/ChangeLog          |    4 +++
 plugins/openoffice/openoffice-write.c |   42 ++++++++++++++------------------
 src/gnm-so-line.c                     |    6 ++--
 src/gnm-so-polygon.c                  |    5 +--
 src/sheet-object-image.c              |    8 +++---
 src/sheet-object-widget.c             |   20 ++++-----------
 src/xml-sax-write.c                   |   12 ++++----
 14 files changed, 96 insertions(+), 94 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index ded24cc..92c5331 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2015-03-07  Morten Welinder  <terra gnome org>
+
+       * src/xml-sax-write.c: Use new go_xml_out_add_double.
+
+       * src/sheet-object-widget.c
+       (sheet_widget_adjustment_write_xml_sax): Use new
+       go_xml_out_add_double.
+
+       * src/sheet-object-image.c (gnm_soi_write_xml_sax): Use new
+       go_xml_out_add_double.
+
 2015-03-05  Morten Welinder  <terra gnome org>
 
        * src/sheet-object-image.c (sheet_object_image_set_image): Drop
diff --git a/configure.ac b/configure.ac
index a549d33..dc607e4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -152,7 +152,7 @@ PKG_PROG_PKG_CONFIG(0.18)
 
 dnl *****************************
 libspreadsheet_reqs="
-       libgoffice-${GOFFICE_API_VER}   >= 0.10.21
+       libgoffice-${GOFFICE_API_VER}   >= 0.10.22
        libgsf-1                >= 1.14.32
        libxml-2.0              >= 2.4.12
 "
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 49ba427..d1e2267 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,5 +1,12 @@
 2015-03-07  Morten Welinder  <terra gnome org>
 
+       * xlsx-write.c: Use new go_xml_out_add_double.
+
+       * xlsx-write-drawing.c: Use new go_xml_out_add_double.
+
+       * xlsx-write-docprops.c (xlsx_write_docprops_app): Use string for
+       version, nont floating point.
+
        * xlsx-write-drawing.c (xlsx_write_chart_float): Drop def_val
        argument.
 
diff --git a/plugins/excel/xlsx-write-docprops.c b/plugins/excel/xlsx-write-docprops.c
index 867d8db..41b8be1 100644
--- a/plugins/excel/xlsx-write-docprops.c
+++ b/plugins/excel/xlsx-write-docprops.c
@@ -284,19 +284,17 @@ xlsx_write_docprops_app (XLSXWriteState *state, GsfOutfile *root_part, GsfOutfil
                 "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties";);
        GsfXMLOut *xml = gsf_xml_out_new (part);
        GsfDocMetaData *meta = go_doc_get_meta_data (GO_DOC (state->base.wb));
-       double version;
+       char *version;
 
        gsf_xml_out_start_element (xml, "Properties");
        gsf_xml_out_add_cstr_unchecked (xml, "xmlns", ns_docprops_extended);
        gsf_xml_out_add_cstr_unchecked (xml, "xmlns:vt", ns_docprops_extended_vt);
-       gsf_xml_out_start_element (xml, "Application");
-       gsf_xml_out_add_cstr_unchecked (xml, NULL, PACKAGE_NAME);
-       gsf_xml_out_end_element (xml); /* </Application> */
-       gsf_xml_out_start_element (xml, "AppVersion");
+       gsf_xml_out_simple_element (xml, "Application", PACKAGE_NAME);
+
        /*1.10.17 is not permitted for AppVersion, so we need to convert it to 1.1017 */
-       version = GNM_VERSION_EPOCH + 0.01 * GNM_VERSION_MAJOR + 0.0001 * GNM_VERSION_MINOR;
-       gsf_xml_out_add_float (xml, NULL, version, 5);
-       gsf_xml_out_end_element (xml); /* </AppVersion> */
+       version = g_strdup_printf ("%d.%02d%02d", GNM_VERSION_EPOCH, GNM_VERSION_MAJOR, GNM_VERSION_MINOR);
+       gsf_xml_out_simple_element (xml, "AppVersion", version);
+       g_free (version);
 
        gsf_doc_meta_data_foreach (meta, (GHFunc) xlsx_meta_write_props_extended, xml);
 
diff --git a/plugins/excel/xlsx-write-drawing.c b/plugins/excel/xlsx-write-drawing.c
index 7a6eb83..ea4d5a4 100644
--- a/plugins/excel/xlsx-write-drawing.c
+++ b/plugins/excel/xlsx-write-drawing.c
@@ -61,7 +61,7 @@ static void
 xlsx_write_chart_float (GsfXMLOut *xml, char const *name, double val)
 {
        gsf_xml_out_start_element (xml, name);
-       gsf_xml_out_add_float (xml, "val", val, -1);
+       go_xml_out_add_double (xml, "val", val);
        gsf_xml_out_end_element (xml);
 }
 
@@ -542,16 +542,16 @@ xlsx_write_go_style_full (GsfXMLOut *xml, GOStyle *style, const XLSXStyleContext
                if (ext_start_arrow) {
                        GOArrow const *arrow = sctx->start_arrow;
                        gsf_xml_out_add_cstr (xml, "StartArrowType", go_arrow_type_as_str (arrow->typ));
-                       gsf_xml_out_add_float (xml, "StartArrowShapeA", arrow->a, -1);
-                       gsf_xml_out_add_float (xml, "StartArrowShapeB", arrow->b, -1);
-                       gsf_xml_out_add_float (xml, "StartArrowShapeC", arrow->c, -1);
+                       go_xml_out_add_double (xml, "StartArrowShapeA", arrow->a);
+                       go_xml_out_add_double (xml, "StartArrowShapeB", arrow->b);
+                       go_xml_out_add_double (xml, "StartArrowShapeC", arrow->c);
                }
                if (ext_end_arrow) {
                        GOArrow const *arrow = sctx->end_arrow;
                        gsf_xml_out_add_cstr (xml, "EndArrowType", go_arrow_type_as_str (arrow->typ));
-                       gsf_xml_out_add_float (xml, "EndArrowShapeA", arrow->a, -1);
-                       gsf_xml_out_add_float (xml, "EndArrowShapeB", arrow->b, -1);
-                       gsf_xml_out_add_float (xml, "EndArrowShapeC", arrow->c, -1);
+                       go_xml_out_add_double (xml, "EndArrowShapeA", arrow->a);
+                       go_xml_out_add_double (xml, "EndArrowShapeB", arrow->b);
+                       go_xml_out_add_double (xml, "EndArrowShapeC", arrow->c);
                }
                if (ext_gradient_rev) {
                        gsf_xml_out_add_uint (xml, "reverse-gradient", 1);
diff --git a/plugins/excel/xlsx-write-pivot.c b/plugins/excel/xlsx-write-pivot.c
index e8e6eb7..f6ed5a1 100644
--- a/plugins/excel/xlsx-write-pivot.c
+++ b/plugins/excel/xlsx-write-pivot.c
@@ -62,7 +62,7 @@ xlsx_write_pivot_val (XLSXWriteState *state, GsfXMLOut *xml,
                        gsf_xml_out_end_element (xml);
                } else {
                        gsf_xml_out_start_element (xml, "n");
-                       gsf_xml_out_add_float (xml, "v", v->v_float.val, -1);
+                       go_xml_out_add_double (xml, "v", v->v_float.val);
                        gsf_xml_out_end_element (xml);
                }
                break;
@@ -233,9 +233,9 @@ xlsx_write_pivot_cache_field (XLSXWriteState *state, GsfXMLOut *xml,
                }
                if (group_by) gsf_xml_out_add_cstr_unchecked (xml, "groupBy", group_by);
                if (bucketer->type == GO_VAL_BUCKET_SERIES_LINEAR) {
-                       gsf_xml_out_add_float (xml, "startNum",         bucketer->details.series.minimum, -1);
-                       gsf_xml_out_add_float (xml, "endNum",           bucketer->details.series.maximum, -1);
-                       gsf_xml_out_add_float (xml, "groupInterval",    bucketer->details.series.step, -1);
+                       go_xml_out_add_double (xml, "startNum",         bucketer->details.series.minimum);
+                       go_xml_out_add_double (xml, "endNum",           bucketer->details.series.maximum);
+                       go_xml_out_add_double (xml, "groupInterval",    bucketer->details.series.step);
                } else {
                        xlsx_write_date (state, xml, "startDate", bucketer->details.dates.minimum);
                        xlsx_write_date (state, xml, "endDate",   bucketer->details.dates.maximum);
@@ -276,8 +276,8 @@ xlsx_write_pivot_cache_definition (XLSXWriteState *state, GsfOutfile *wb_part,
        if (cache->refreshed_by) gsf_xml_out_add_cstr (xml, "refreshedBy", cache->refreshed_by);
        if (cache->refreshed_on) {
                if (state->version == ECMA_376_2006)
-                       gsf_xml_out_add_float (xml, "refreshedDate",
-                                              go_val_as_float (cache->refreshed_on), -1);
+                       go_xml_out_add_double (xml, "refreshedDate",
+                                              go_val_as_float (cache->refreshed_on));
                else {
                        GOFormat const *format = go_format_new_from_XL ("yyyy-mm-dd\"T\"hh:mm:ss");
                        gchar *date = format_value (format, cache->refreshed_on, -1, NULL);
diff --git a/plugins/excel/xlsx-write.c b/plugins/excel/xlsx-write.c
index 5d19972..9a1e02b 100644
--- a/plugins/excel/xlsx-write.c
+++ b/plugins/excel/xlsx-write.c
@@ -748,9 +748,8 @@ xlsx_write_font (XLSXWriteState *state, GsfXMLOut *xml, GnmStyle const *style)
        }
        if (gnm_style_is_element_set (style, MSTYLE_FONT_SIZE)) {
                gsf_xml_out_start_element (xml, "sz");
-               gsf_xml_out_add_float
-                       (xml, "val", gnm_style_get_font_size (style),
-                        2);
+               go_xml_out_add_double
+                       (xml, "val", gnm_style_get_font_size (style));
                gsf_xml_out_end_element (xml);
 
        }
@@ -1569,7 +1568,7 @@ xlsx_write_cells (XLSXWriteState *state, GsfXMLOut *xml,
                        }
                        if (ri->hard_size || fabs (ri->size_pts - sheet->cols.default_style.size_pts) > 1e-6) 
{
                                xlsx_write_init_row (&needs_row, xml, r, cheesy_span);
-                               gsf_xml_out_add_float (xml, "ht", ri->size_pts, 4);
+                               go_xml_out_add_double (xml, "ht", ri->size_pts);
                        }
                        if (ri->is_collapsed) {
                                xlsx_write_init_row (&needs_row, xml, r, cheesy_span);
@@ -2111,9 +2110,9 @@ xlsx_write_col (XLSXWriteState *state, GsfXMLOut *xml,
        gsf_xml_out_add_int (xml, "max", last + 1);
        gsf_xml_out_add_int (xml, "style", style_id);
 
-       gsf_xml_out_add_float (xml, "width",
+       go_xml_out_add_double (xml, "width",
                               (ci ? ci->size_pts : def_width) /
-                              ((130. / 18.5703125) * (72./96.)), 7);
+                              ((130. / 18.5703125) * (72./96.)));
 
        if (ci) {
                if (!ci->visible)
@@ -2249,7 +2248,7 @@ xlsx_write_autofilters (XLSXWriteState *state, GsfXMLOut *xml)
                case GNM_FILTER_OP_TOP_N_PERCENT:
                case GNM_FILTER_OP_BOTTOM_N_PERCENT:
                        gsf_xml_out_start_element (xml, "top10");
-                       gsf_xml_out_add_float (xml, "val", cond->count, -1);
+                       go_xml_out_add_double (xml, "val", cond->count);
                        if (cond->op[0] & GNM_FILTER_OP_BOTTOM_MASK)
                                gsf_xml_out_add_cstr_unchecked (xml, "top", "0");
                        if (cond->op[0] & GNM_FILTER_OP_PERCENT_MASK)
@@ -2544,12 +2543,12 @@ xlsx_write_print_info (XLSXWriteState *state, GsfXMLOut *xml)
        gsf_xml_out_start_element (xml, "pageMargins");
        print_info_get_margins (pi, &h_margin, &f_margin, &left, &right,
                                &t_margin, &b_margin);
-       gsf_xml_out_add_float (xml, "left",     left / 72., 4);
-       gsf_xml_out_add_float (xml, "right",    right / 72., 4);
-       gsf_xml_out_add_float (xml, "top",      t_margin / 72., 4);
-       gsf_xml_out_add_float (xml, "bottom",   b_margin / 72., 4);
-       gsf_xml_out_add_float (xml, "header",   h_margin / 72., 4);
-       gsf_xml_out_add_float (xml, "footer",   f_margin / 72., 4);
+       go_xml_out_add_double (xml, "left",     left / 72.);
+       go_xml_out_add_double (xml, "right",    right / 72.);
+       go_xml_out_add_double (xml, "top",      t_margin / 72.);
+       go_xml_out_add_double (xml, "bottom",   b_margin / 72.);
+       go_xml_out_add_double (xml, "header",   h_margin / 72.);
+       go_xml_out_add_double (xml, "footer",   f_margin / 72.);
        gsf_xml_out_end_element (xml); /* </pageMargins> */
 
        gsf_xml_out_start_element (xml, "pageSetup");
@@ -2850,8 +2849,8 @@ xlsx_write_sheet (XLSXWriteState *state, GsfOutfile *wb_part, Sheet *sheet)
        gsf_xml_out_end_element (xml); /* </sheetViews> */
 /*   element sheetFormatPr { CT_SheetFormatPr }?,     */
        gsf_xml_out_start_element (xml, "sheetFormatPr");
-       gsf_xml_out_add_float (xml, "defaultRowHeight",
-               sheet_row_get_default_size_pts (state->sheet), 4);
+       go_xml_out_add_double (xml, "defaultRowHeight",
+               sheet_row_get_default_size_pts (state->sheet));
        if (state->sheet->rows.max_outline_level > 0)
                gsf_xml_out_add_int (xml, "outlineLevelRow",
                        state->sheet->rows.max_outline_level);
@@ -2984,8 +2983,8 @@ xlsx_write_calcPR (XLSXWriteState *state, GsfXMLOut *xml)
        xlsx_add_bool (xml, "iterate", wb->iteration.enabled);
        gsf_xml_out_add_int (xml, "iterateCount",
                wb->iteration.max_number);
-       gsf_xml_out_add_float (xml, "iterateDelta",
-               wb->iteration.tolerance, -1);
+       go_xml_out_add_double (xml, "iterateDelta",
+               wb->iteration.tolerance);
 
        gsf_xml_out_end_element (xml);
 }
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index 6f4093e..760e9e0 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,3 +1,7 @@
+2015-03-07  Morten Welinder  <terra gnome org>
+
+       * openoffice-write.c: Use new go_xml_out_add_double.
+
 2015-03-04  Morten Welinder <terra gnome org>
 
        * Release 1.12.21
diff --git a/plugins/openoffice/openoffice-write.c b/plugins/openoffice/openoffice-write.c
index 9e3e1cb..8c34541 100644
--- a/plugins/openoffice/openoffice-write.c
+++ b/plugins/openoffice/openoffice-write.c
@@ -682,7 +682,7 @@ odf_write_plot_style_double (GsfXMLOut *xml, GogObject const *plot,
 {
        double d;
        if (gnm_object_has_readable_prop (plot, property, G_TYPE_DOUBLE, &d))
-               gsf_xml_out_add_float (xml, id, d, -1);
+               go_xml_out_add_double (xml, id, d);
 }
 
 static void
@@ -4042,12 +4042,9 @@ odf_write_sheet_control_scrollbar (GnmOOExport *state, SheetObject *so,
        gsf_xml_out_add_cstr (state->xml, FORM "orientation",
                              sheet_widget_adjustment_get_horizontal (so) ?
                              "horizontal" : "vertical");
-       gsf_xml_out_add_float (state->xml, FORM "value",
-                      gtk_adjustment_get_value (adj), -1);
-       gsf_xml_out_add_float (state->xml, FORM "min-value",
-                      gtk_adjustment_get_lower (adj), -1);
-       gsf_xml_out_add_float (state->xml, FORM "max-value",
-                      gtk_adjustment_get_upper (adj), -1);
+       go_xml_out_add_double (state->xml, FORM "value", gtk_adjustment_get_value (adj));
+       go_xml_out_add_double (state->xml, FORM "min-value", gtk_adjustment_get_lower (adj));
+       go_xml_out_add_double (state->xml, FORM "max-value", gtk_adjustment_get_upper (adj));
        gsf_xml_out_add_int (state->xml, FORM "step-size",
                             (int)(gtk_adjustment_get_step_increment (adj) + 0.5));
        gsf_xml_out_add_int (state->xml, FORM "page-step-size",
@@ -4741,8 +4738,8 @@ odf_print_spreadsheet_content_prelude (GnmOOExport *state)
        gsf_xml_out_add_cstr_unchecked (state->xml, TABLE "value-type", "date");
        gsf_xml_out_end_element (state->xml); /* </table:null-date> */
        gsf_xml_out_start_element (state->xml, TABLE "iteration");
-       gsf_xml_out_add_float (state->xml, TABLE "maximum-difference",
-                              state->wb->iteration.tolerance, -1);
+       go_xml_out_add_double (state->xml, TABLE "maximum-difference",
+                              state->wb->iteration.tolerance);
        gsf_xml_out_add_cstr_unchecked (state->xml, TABLE "status",
                                        state->wb->iteration.enabled ?  "enable" : "disable");
        gsf_xml_out_add_int (state->xml, TABLE "steps", state->wb->iteration.max_number);
@@ -5723,9 +5720,9 @@ odf_write_arrow_marker_info (GOArrow const *arrow, char const *name, GnmOOExport
 
        if (state->with_extension) {
                gsf_xml_out_add_int (state->xml, GNMSTYLE "arrow-type", arrow->typ);
-               gsf_xml_out_add_float (state->xml, GNMSTYLE "arrow-a", arrow->a, -1);
-               gsf_xml_out_add_float (state->xml, GNMSTYLE "arrow-b", arrow->b, -1);
-               gsf_xml_out_add_float (state->xml, GNMSTYLE "arrow-c", arrow->c, -1);
+               go_xml_out_add_double (state->xml, GNMSTYLE "arrow-a", arrow->a);
+               go_xml_out_add_double (state->xml, GNMSTYLE "arrow-b", arrow->b);
+               go_xml_out_add_double (state->xml, GNMSTYLE "arrow-c", arrow->c);
        }
 
        gsf_xml_out_add_cstr (state->xml, SVG "viewBox", "0 0 20 30");
@@ -5772,8 +5769,8 @@ odf_write_gradient_info (GOStyle const *style, char const *name, GnmOOExport *st
        g_free (color);
 
        if (style->fill.gradient.brightness >= 0.0 && state->with_extension)
-               gsf_xml_out_add_float (state->xml, GNMSTYLE "brightness",
-                                      style->fill.gradient.brightness, -1);
+               go_xml_out_add_double (state->xml, GNMSTYLE "brightness",
+                                      style->fill.gradient.brightness);
 
        color = odf_go_color_to_string (style->fill.pattern.fore);
        gsf_xml_out_add_cstr_unchecked (state->xml, DRAW "end-color", color);
@@ -6437,8 +6434,8 @@ odf_write_data_attribute (GnmOOExport *state, GOData const *data, GnmParsePos *p
                                gsf_xml_out_add_cstr (state->xml, c_attribute, 
                                                      value_peek_string (v));
                        if (NULL != v && VALUE_IS_FLOAT (v))
-                               gsf_xml_out_add_float (state->xml, c_attribute, 
-                                                      value_get_as_float (v), -1);
+                               go_xml_out_add_double (state->xml, c_attribute, 
+                                                      value_get_as_float (v));
                }
        }
 }
@@ -7049,7 +7046,7 @@ odf_write_axis_style (GnmOOExport *state, GOStyle const *style,
        tmp = gog_axis_get_entry
                (GOG_AXIS (axis), GOG_AXIS_ELEM_MIN, &user_defined);
        if (user_defined) {
-               gsf_xml_out_add_float (state->xml, CHART "minimum", tmp, -1);
+               go_xml_out_add_double (state->xml, CHART "minimum", tmp);
                if (state->with_extension)
                        odf_add_expr (state, GOG_OBJECT (axis), 0, 
                                      GNMSTYLE "chart-minimum-expression", NULL);
@@ -7057,7 +7054,7 @@ odf_write_axis_style (GnmOOExport *state, GOStyle const *style,
        tmp = gog_axis_get_entry
                (GOG_AXIS (axis), GOG_AXIS_ELEM_MAX, &user_defined);
        if (user_defined) {
-               gsf_xml_out_add_float (state->xml, CHART "maximum", tmp, -1);
+               go_xml_out_add_double (state->xml, CHART "maximum", tmp);
                if (state->with_extension)
                        odf_add_expr (state, GOG_OBJECT (axis), 1, 
                                      GNMSTYLE "chart-maximum-expression", NULL);               
@@ -7069,11 +7066,8 @@ odf_write_axis_style (GnmOOExport *state, GOStyle const *style,
                        = gnm_go_data_get_expr (interval);
                if (texpr != NULL &&
                    GNM_EXPR_GET_OPER (texpr->expr) == GNM_EXPR_OP_CONSTANT) {
-                       double val = value_get_as_float
-                               (texpr->expr->constant.value);
-                       gsf_xml_out_add_float
-                               (state->xml,
-                                CHART "interval-major", val, -1);
+                       double val = value_get_as_float (texpr->expr->constant.value);
+                       go_xml_out_add_double (state->xml, CHART "interval-major", val);
 
                        interval = gog_dataset_get_dim (GOG_DATASET(axis),3);
                        if (interval != NULL) {
@@ -8463,7 +8457,7 @@ odf_write_plot_style_affine (GsfXMLOut *xml, GogObject const *plot, float interc
        if (gnm_object_has_readable_prop (plot, "affine", G_TYPE_BOOLEAN, &b)) {
                odf_add_bool (xml, GNMSTYLE "regression-affine", b);
                odf_add_bool (xml, LOEXT "regression-force-intercept", !b);
-               gsf_xml_out_add_float (xml, LOEXT "regression-intercept-value", intercept, -1); 
+               go_xml_out_add_double (xml, LOEXT "regression-intercept-value", intercept);     
        }
 }
 
diff --git a/src/gnm-so-line.c b/src/gnm-so-line.c
index 0cf88fb..b5dfdeb 100644
--- a/src/gnm-so-line.c
+++ b/src/gnm-so-line.c
@@ -228,15 +228,15 @@ write_xml_sax_arrow (GOArrow const *arrow, const char *prefix,
        g_free (attr);
 
        attr = g_strconcat (prefix, "ArrowShapeA", NULL);
-       gsf_xml_out_add_float (output, attr, arrow->a, -1);
+       go_xml_out_add_double (output, attr, arrow->a);
        g_free (attr);
 
        attr = g_strconcat (prefix, "ArrowShapeB", NULL);
-       gsf_xml_out_add_float (output, attr, arrow->b, -1);
+       go_xml_out_add_double (output, attr, arrow->b);
        g_free (attr);
 
        attr = g_strconcat (prefix, "ArrowShapeC", NULL);
-       gsf_xml_out_add_float (output, attr, arrow->c, -1);
+       go_xml_out_add_double (output, attr, arrow->c);
        g_free (attr);
 }
 
diff --git a/src/gnm-so-polygon.c b/src/gnm-so-polygon.c
index 5149547..4273630 100644
--- a/src/gnm-so-polygon.c
+++ b/src/gnm-so-polygon.c
@@ -183,14 +183,13 @@ gnm_so_polygon_write_xml_sax (SheetObject const *so, GsfXMLOut *output,
 {
        GnmSOPolygon const *sop = GNM_SO_POLYGON (so);
        unsigned int ui;
-       int prec = convs ? convs->output.decimal_digits : -1;
 
        for (ui = 0; ui + 1 < (sop->points ? sop->points->len : 0); ui += 2) {
                double x = g_array_index (sop->points, double, ui);
                double y = g_array_index (sop->points, double, ui + 1);
                gsf_xml_out_start_element (output, "Point");
-               gsf_xml_out_add_float (output, "x", x, prec);
-               gsf_xml_out_add_float (output, "y", y, prec);
+               go_xml_out_add_double (output, "x", x);
+               go_xml_out_add_double (output, "y", y);
                gsf_xml_out_end_element (output); /* </Point> */
        }
 
diff --git a/src/sheet-object-image.c b/src/sheet-object-image.c
index bf4c681..8857226 100644
--- a/src/sheet-object-image.c
+++ b/src/sheet-object-image.c
@@ -411,10 +411,10 @@ gnm_soi_write_xml_sax (SheetObject const *so, GsfXMLOut *output,
        g_return_if_fail (GNM_IS_SO_IMAGE (so));
        soi = GNM_SO_IMAGE (so);
 
-       gsf_xml_out_add_float (output, "crop-top", soi->crop_top, 3);
-       gsf_xml_out_add_float (output, "crop-bottom", soi->crop_bottom, 3);
-       gsf_xml_out_add_float (output, "crop-left", soi->crop_left, 3);
-       gsf_xml_out_add_float (output, "crop-right", soi->crop_right, 3);
+       go_xml_out_add_double (output, "crop-top", soi->crop_top);
+       go_xml_out_add_double (output, "crop-bottom", soi->crop_bottom);
+       go_xml_out_add_double (output, "crop-left", soi->crop_left);
+       go_xml_out_add_double (output, "crop-right", soi->crop_right);
        gsf_xml_out_start_element (output, "Content");
        if (soi->type != NULL)
                gsf_xml_out_add_cstr (output, "image-type", soi->type);
diff --git a/src/sheet-object-widget.c b/src/sheet-object-widget.c
index 5d9c539..c2d3229 100644
--- a/src/sheet-object-widget.c
+++ b/src/sheet-object-widget.c
@@ -1803,21 +1803,11 @@ sheet_widget_adjustment_write_xml_sax (SheetObject const *so, GsfXMLOut *output,
        SheetWidgetAdjustment const *swa = GNM_SOW_ADJUSTMENT (so);
        SheetWidgetAdjustmentClass *swa_class = SWA_CLASS (so);
 
-       gsf_xml_out_add_float (output, "Min",
-                              gtk_adjustment_get_lower (swa->adjustment),
-                              -1);
-       gsf_xml_out_add_float (output, "Max",
-                              gtk_adjustment_get_upper (swa->adjustment),
-                              -1); /* allow scrolling to max */
-       gsf_xml_out_add_float (output, "Inc",
-                              gtk_adjustment_get_step_increment (swa->adjustment),
-                              -1);
-       gsf_xml_out_add_float (output, "Page",
-                              gtk_adjustment_get_page_increment (swa->adjustment),
-                              -1);
-       gsf_xml_out_add_float (output, "Value",
-                              gtk_adjustment_get_value (swa->adjustment),
-                              -1);
+       go_xml_out_add_double (output, "Min", gtk_adjustment_get_lower (swa->adjustment));
+       go_xml_out_add_double (output, "Max", gtk_adjustment_get_upper (swa->adjustment));
+       go_xml_out_add_double (output, "Inc", gtk_adjustment_get_step_increment (swa->adjustment));
+       go_xml_out_add_double (output, "Page", gtk_adjustment_get_page_increment (swa->adjustment));
+       go_xml_out_add_double (output, "Value", gtk_adjustment_get_value (swa->adjustment));
 
        if (swa_class->has_orientation)
                gsf_xml_out_add_bool (output, "Horizontal", swa->horizontal);
diff --git a/src/xml-sax-write.c b/src/xml-sax-write.c
index 2782517..9975ef4 100644
--- a/src/xml-sax-write.c
+++ b/src/xml-sax-write.c
@@ -363,11 +363,11 @@ xml_write_print_info (GnmOutputXML *state, GnmPrintInformation *pi)
        gsf_xml_out_start_element (state->output, GNM "Scale");
        if (pi->scaling.type == PRINT_SCALE_PERCENTAGE) {
                gsf_xml_out_add_cstr_unchecked  (state->output, "type", "percentage");
-               gsf_xml_out_add_float  (state->output, "percentage", pi->scaling.percentage.x, -1);
+               go_xml_out_add_double  (state->output, "percentage", pi->scaling.percentage.x);
        } else {
                gsf_xml_out_add_cstr_unchecked  (state->output, "type", "size_fit");
-               gsf_xml_out_add_float  (state->output, "cols", pi->scaling.dim.cols, -1);
-               gsf_xml_out_add_float  (state->output, "rows", pi->scaling.dim.rows, -1);
+               go_xml_out_add_double  (state->output, "cols", pi->scaling.dim.cols);
+               go_xml_out_add_double  (state->output, "rows", pi->scaling.dim.rows);
        }
        gsf_xml_out_end_element (state->output);
 
@@ -998,7 +998,7 @@ xml_write_filter_field (GnmOutputXML *state,
                        cond->op[0] & 1 ? TRUE : FALSE);
                gsf_xml_out_add_bool (state->output, "items",
                        cond->op[0] & 2 ? TRUE : FALSE);
-               gsf_xml_out_add_float (state->output, "count", cond->count, 4);
+               go_xml_out_add_double (state->output, "count", cond->count);
                break;
        }
 
@@ -1406,8 +1406,8 @@ xml_write_calculation (GnmOutputXML *state)
                "EnableIteration",      state->wb->iteration.enabled);
        gsf_xml_out_add_int (state->output,
                "MaxIterations",        state->wb->iteration.max_number);
-       gsf_xml_out_add_float (state->output,
-               "IterationTolerance",   state->wb->iteration.tolerance, -1);
+       go_xml_out_add_double (state->output,
+               "IterationTolerance",   state->wb->iteration.tolerance);
        xml_write_date_conventions_as_attr (state,
                                            workbook_date_conv (state->wb));
        xml_write_number_system (state);


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