[gnumeric] xlsx: export label of buttons too.



commit 412b23f9fbcde71e5342fc99a4981dc01bb8d533
Author: Morten Welinder <terra gnome org>
Date:   Fri Feb 20 16:20:09 2015 -0500

    xlsx: export label of buttons too.

 plugins/excel/ChangeLog            |    1 +
 plugins/excel/xlsx-write-drawing.c |   14 ++++++++++++++
 2 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/plugins/excel/ChangeLog b/plugins/excel/ChangeLog
index d1f9fb3..8408485 100644
--- a/plugins/excel/ChangeLog
+++ b/plugins/excel/ChangeLog
@@ -2,6 +2,7 @@
 
        * xlsx-write-drawing.c (xlsx_write_legacy_drawing_objects): Define
        and reference shapetype.
+       (xlsx_write_legacy_drawing_objects): Export label too.
 
 2015-02-19  Morten Welinder  <terra gnome org>
 
diff --git a/plugins/excel/xlsx-write-drawing.c b/plugins/excel/xlsx-write-drawing.c
index f7df9a9..04f3423 100644
--- a/plugins/excel/xlsx-write-drawing.c
+++ b/plugins/excel/xlsx-write-drawing.c
@@ -1399,6 +1399,9 @@ xlsx_write_legacy_drawing_objects (XLSXWriteState *state, GsfOutput *sheet_part,
                double res_pts[4] = {0.,0.,0.,0.};
                GtkAdjustment *adj = NULL;
                int horiz = -1;
+               gboolean has_text_prop =
+                       g_object_class_find_property (G_OBJECT_GET_CLASS (so), "text") != NULL;
+               char *text = NULL;
 
                sheet_object_position_pts_get (so, res_pts);
 
@@ -1415,6 +1418,17 @@ xlsx_write_legacy_drawing_objects (XLSXWriteState *state, GsfOutput *sheet_part,
                        g_string_free (str, TRUE);
                }
 
+               if (has_text_prop)
+                       g_object_get (so, "text", &text, NULL);
+               if (text) {
+                       gsf_xml_out_start_element (xml, "v:textbox");
+                       gsf_xml_out_start_element (xml, "div");
+                       gsf_xml_out_add_cstr (xml, NULL, text);
+                       gsf_xml_out_end_element (xml);  /* </div> */
+                       gsf_xml_out_end_element (xml);  /* </v:textbox> */
+                       g_free (text);
+               }
+
                gsf_xml_out_start_element (xml, "x:ClientData");
                if (GNM_IS_SOW_SCROLLBAR (so) || GNM_IS_SOW_SLIDER (so)) {
                        otype = "Scroll";


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