[gnumeric] xlsx: fix export of column width.



commit 8213a120da9a8204aff93a53f9ec714dc0480236
Author: Morten Welinder <terra gnome org>
Date:   Thu Feb 12 13:56:14 2015 -0500

    xlsx: fix export of column width.

 plugins/excel/ChangeLog    |    5 +++++
 plugins/excel/xlsx-write.c |    6 ++++--
 2 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 74736ff..13c611c 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,8 @@
+2015-02-12  Morten Welinder  <terra gnome org>
+
+       * xlsx-write.c (xlsx_write_col): Always write column width.
+       Otherwise Excel might see zero.
+
 2015-02-10  Morten Welinder  <terra gnome org>
 
        * xlsx-write-drawing.c (xlsx_write_drawing_objects): Save arrow
diff --git a/plugins/excel/xlsx-write.c b/plugins/excel/xlsx-write.c
index 34f4148..e2fc112 100644
--- a/plugins/excel/xlsx-write.c
+++ b/plugins/excel/xlsx-write.c
@@ -2066,9 +2066,11 @@ 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",
+                              (ci ? ci->size_pts : def_width) /
+                              ((130. / 18.5703125) * (72./96.)), 7);
+
        if (ci) {
-               gsf_xml_out_add_float (xml, "width",
-                                      ci->size_pts / ((130. / 18.5703125) * (72./96.)), 7);
                if (!ci->visible)
                        gsf_xml_out_add_cstr_unchecked (xml, "hidden", "1");
                if (ci->hard_size)


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