[gnumeric] Improve chart roundtrip through ODF. [#728197]



commit dc2ec434c82d548e2af112ebb85b0b68ea7e7d81
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Thu Apr 17 23:11:30 2014 -0600

    Improve chart roundtrip through ODF. [#728197]
    
    2014-04-17  Andreas J. Guelzow <aguelzow pyrshep ca>
    
        * openoffice-read.c (od_draw_object): set width-pts and height-pts
        * openoffice-write.c (odf_add_pt): write 6 decimals

 NEWS                                  |    3 ++-
 plugins/openoffice/ChangeLog          |    5 +++++
 plugins/openoffice/openoffice-read.c  |    5 +++++
 plugins/openoffice/openoffice-write.c |    2 +-
 4 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/NEWS b/NEWS
index 8a5d4b2..eb1c237 100644
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,8 @@
 Gnumeric 1.12.15
 
 Andreas:
-       * Fix chart size in ODF import. [#728197]
+       * Fix chart size in ODF import. [#728278]
+       * Improve chart roundtrip through ODF. [#728197]
 
 Morten:
        * For xlsx, don't complain over "ext" elements.
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index 00e28d0..decc029 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,3 +1,8 @@
+2014-04-17  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+       * openoffice-read.c (od_draw_object): set width-pts and height-pts
+       * openoffice-write.c (odf_add_pt): write 6 decimals
+
 2014-04-16  Andreas J. Guelzow <aguelzow pyrshep ca>
 
        * openoffice-read.c (oo_plot_area): default to manual size
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index b3d9caa..03fb7da 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -7879,6 +7879,11 @@ od_draw_object (GsfXMLIn *xin, xmlChar const **attrs)
        for (i = 0; i < OO_CHART_STYLE_INHERITANCE; i++)
                state->chart.i_plot_styles[i] = NULL;
 
+       if (state->chart.width != go_nan)
+               g_object_set (state->chart.graph, "width-pts", state->chart.width, NULL);
+       if (state->chart.height != go_nan)
+               g_object_set (state->chart.graph, "height-pts", state->chart.height, NULL);     
+
        pop_hash (&state->chart.saved_graph_styles, &state->chart.graph_styles);
        pop_hash (&state->chart.saved_hatches, &state->chart.hatches);
        pop_hash (&state->chart.saved_dash_styles, &state->chart.dash_styles);
diff --git a/plugins/openoffice/openoffice-write.c b/plugins/openoffice/openoffice-write.c
index d4549b7..11d1a7e 100644
--- a/plugins/openoffice/openoffice-write.c
+++ b/plugins/openoffice/openoffice-write.c
@@ -564,7 +564,7 @@ odf_add_pt (GsfXMLOut *xml, char const *id, double l)
 {
        GString *str = g_string_new (NULL);
 
-       g_string_append_printf (str, "%.2fpt", l);
+       g_string_append_printf (str, "%.6fpt", l);
        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]