[gnumeric] xlsx: improve button export.



commit 61e1ef140f858164a131cdbe8cdbe6e7e3ed58f2
Author: Morten Welinder <terra gnome org>
Date:   Fri Feb 20 15:47:56 2015 -0500

    xlsx: improve button export.
    
    This makes xl at least see the shape.  It still complains, though.

 plugins/excel/ChangeLog            |    5 +++++
 plugins/excel/xlsx-write-drawing.c |    6 ++++++
 2 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index 2bcbc23..d1f9fb3 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -1,3 +1,8 @@
+2015-02-20  Morten Welinder  <terra gnome org>
+
+       * xlsx-write-drawing.c (xlsx_write_legacy_drawing_objects): Define
+       and reference shapetype.
+
 2015-02-19  Morten Welinder  <terra gnome org>
 
        * xlsx-write-drawing.c (xlsx_write_go_style_full): Write gradient
diff --git a/plugins/excel/xlsx-write-drawing.c b/plugins/excel/xlsx-write-drawing.c
index dc4cf27..f7df9a9 100644
--- a/plugins/excel/xlsx-write-drawing.c
+++ b/plugins/excel/xlsx-write-drawing.c
@@ -1364,6 +1364,7 @@ xlsx_write_legacy_drawing_objects (XLSXWriteState *state, GsfOutput *sheet_part,
        GsfOutput *drawing_part;
        GsfXMLOut *xml;
        GnmParsePos pp0;
+       const char *shapetype = "#_x0000_t201";
 
        parse_pos_init_sheet (&pp0, state->sheet);
 
@@ -1387,6 +1388,10 @@ xlsx_write_legacy_drawing_objects (XLSXWriteState *state, GsfOutput *sheet_part,
        gsf_xml_out_add_cstr_unchecked (xml, "xmlns:o", ns_leg_office);
        gsf_xml_out_add_cstr_unchecked (xml, "xmlns:x", ns_leg_excel);
 
+       gsf_xml_out_start_element (xml, "v:shapetype");
+       gsf_xml_out_add_cstr (xml, "id", shapetype);
+       gsf_xml_out_end_element (xml);  /* </v:shapetype> */
+
        for (obj = objects ; obj != NULL ; obj = obj->next) {
                SheetObject *so = obj->data;
                const char *otype = NULL;
@@ -1398,6 +1403,7 @@ xlsx_write_legacy_drawing_objects (XLSXWriteState *state, GsfOutput *sheet_part,
                sheet_object_position_pts_get (so, res_pts);
 
                gsf_xml_out_start_element (xml, "v:shape");
+               gsf_xml_out_add_cstr (xml, "type", shapetype);
                {
                        GString *str = g_string_new (NULL);
                        g_string_append (str, "position:absolute;");


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