[gnumeric] ods: roundtrip improvement for lengths.



commit eb8b7f3b3ba99b9e5a3a7baa1a6b4e0070232c13
Author: Morten Welinder <terra gnome org>
Date:   Sun May 11 11:24:48 2014 -0400

    ods: roundtrip improvement for lengths.

 plugins/openoffice/ChangeLog          |    5 +++++
 plugins/openoffice/openoffice-write.c |    4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index aa54581..37445e9 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,3 +1,8 @@
+2014-05-11  Morten Welinder  <terra gnome org>
+
+       * openoffice-write.c (odf_add_pt): Use sufficient precision to
+       roundtrip.
+
 2014-05-10  Morten Welinder  <terra gnome org>
 
        * openoffice-write.c (odf_write_gog_style_chart): Write marker
diff --git a/plugins/openoffice/openoffice-write.c b/plugins/openoffice/openoffice-write.c
index fd7c498..df82686 100644
--- a/plugins/openoffice/openoffice-write.c
+++ b/plugins/openoffice/openoffice-write.c
@@ -564,8 +564,8 @@ static void
 odf_add_pt (GsfXMLOut *xml, char const *id, double l)
 {
        GString *str = g_string_new (NULL);
-
-       g_string_append_printf (str, "%.6fpt", l);
+       go_dtoa (str, "!g", l);
+       g_string_append (str, "pt");
        gsf_xml_out_add_cstr_unchecked (xml, id, str->str);
        g_string_free (str, TRUE);
 }


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