[gnumeric] Import invisible alignment characters in number formats from ODF. [part of #725852]



commit 2e350c3084528e691242948e00cb15581f1ea98a
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Thu Mar 6 22:24:48 2014 -0700

    Import invisible alignment characters in number formats from ODF. [part of #725852]
    
    2014-03-06  Andreas J. Guelzow <aguelzow pyrshep ca>
    
        * openoffice-read.c (odf_number_invisible_text): new

 NEWS                                 |    2 ++
 plugins/openoffice/ChangeLog         |    4 ++++
 plugins/openoffice/openoffice-read.c |   15 +++++++++++++++
 3 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/NEWS b/NEWS
index 504824c..4e3fcc0 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ Gnumeric 1.12.13
 Andreas:
        * Fix export of comboboxes to ODF.
        * Fix export of help messages to ODF.
+       * Import invisible alignment characters in number formats from ODF.
+         [part of #725852]
 
 Morten:
        * Support volatile functions.  [#305798]
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index 05ac584..affe6c8 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,3 +1,7 @@
+2014-03-06  Andreas J. Guelzow <aguelzow pyrshep ca>
+
+       * openoffice-read.c (odf_number_invisible_text): new
+
 2014-03-05  Andreas J. Guelzow <aguelzow pyrshep ca>
 
        * openoffice-write.c (odf_print_spreadsheet_content_validations):
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index 732bf91..b09f15c 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -5159,6 +5159,20 @@ attr_eq_ncase (xmlChar const *a, char const *s, int n)
 }
 
 static void
+odf_number_invisible_text (GsfXMLIn *xin, xmlChar const **attrs)
+{
+       OOParseState *state = (OOParseState *)xin->user_state;
+       char const *text = NULL;
+
+       for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
+               if (gsf_xml_in_namecmp (xin, CXML2C (attrs[0]), OO_GNUM_NS_EXT, "char"))
+                       text = CXML2C (attrs[1]);
+
+       g_string_append_c (state->cur_format.accum, '_');
+       g_string_append (state->cur_format.accum, text);
+}
+
+static void
 odf_number_color (GsfXMLIn *xin, xmlChar const **attrs)
 {
        OOParseState *state = (OOParseState *)xin->user_state;
@@ -10824,6 +10838,7 @@ GSF_XML_IN_NODE (OFFICE_DOC_STYLES, OFFICE_STYLES, OO_NS_OFFICE, "styles", GSF_X
     GSF_XML_IN_NODE (NUMBER_STYLE, NUMBER_STYLE_PROP, OO_NS_STYLE,     "properties", GSF_XML_NO_CONTENT, 
NULL, NULL),
     GSF_XML_IN_NODE (NUMBER_STYLE, NUMBER_MAP, OO_NS_STYLE,            "map", GSF_XML_NO_CONTENT, &odf_map, 
NULL),
     GSF_XML_IN_NODE (NUMBER_STYLE, NUMBER_TEXT_PROP, OO_NS_STYLE,      "text-properties", 
GSF_XML_NO_CONTENT, &odf_number_color, NULL),
+    GSF_XML_IN_NODE (NUMBER_STYLE, NUMBER_TEXT_INVISBLE, OO_GNUM_NS_EXT, "invisible", GSF_XML_NO_CONTENT, 
&odf_number_invisible_text, NULL),
 
   GSF_XML_IN_NODE (OFFICE_STYLES, DATE_STYLE, OO_NS_NUMBER, "date-style", GSF_XML_NO_CONTENT, 
&oo_date_style, &oo_date_style_end),
     GSF_XML_IN_NODE (DATE_STYLE, DATE_DAY, OO_NS_NUMBER,               "day", GSF_XML_NO_CONTENT,      
&oo_date_day, NULL),


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