[goffice] Write invisible '_)' also as blanks for LO and friends



commit 55ff1e1f9f6ba10c3823cc53270e91bddef3f658
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Sun Mar 9 22:53:43 2014 -0600

    Write invisible '_)' also as blanks for LO and friends
    
    2014-03-09 Andreas J. Guelzow <aguelzow pyrshep ca>
    
        * goffice/utils/go-format.c (go_format_output_number_to_odf): write
        invisible characters but also write blank for LO and friends

 ChangeLog                 |    5 +++++
 goffice/utils/go-format.c |   20 +++++++++++++++-----
 2 files changed, 20 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 8800899..b2bdd15 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-03-09 Andreas J. Guelzow <aguelzow pyrshep ca>
+
+       * goffice/utils/go-format.c (go_format_output_number_to_odf): write
+       invisible characters but also write blank for LO and friends
+
 2014-03-06 Andreas J. Guelzow <aguelzow pyrshep ca>
 
        * goffice/utils/go-format.c (go_format_output_scientific_number_to_odf):
diff --git a/goffice/utils/go-format.c b/goffice/utils/go-format.c
index 44de028..a4258a3 100644
--- a/goffice/utils/go-format.c
+++ b/goffice/utils/go-format.c
@@ -7371,6 +7371,7 @@ go_format_locale_currency (void)
 #define FOSTYLE         "fo:"
 #define NUMBER   "number:"
 #define GNMSTYLE "gnm:"
+#define OFFICE   "office:"
 
 
 #ifdef DEFINE_COMMON
@@ -8202,20 +8203,29 @@ go_format_output_number_to_odf (GsfXMLOut *xout, GOFormat const *fmt,
                        ODF_WRITE_NUMBER;
                        break;
 
-               case TOK_INVISIBLE_CHAR: 
-                       if (with_extension) {
-                               size_t len = g_utf8_next_char(token + 1) - (token + 1);
-                               if (len > 0) {
+               case TOK_INVISIBLE_CHAR: {
+                       size_t len = g_utf8_next_char(token + 1) - (token + 1);
+                       if (len > 0) {
+                               if (with_extension) {
                                        gchar *text = g_strndup (token + 1, len);
                                        ODF_WRITE_NUMBER;
+                                       ODF_OPEN_STRING;
+                                       gsf_xml_out_add_cstr (xout, NULL, accum->str);
+                                       g_string_erase (accum, 0, -1);
+                                       gsf_xml_out_add_cstr (xout, NULL, " ");
                                        gsf_xml_out_start_element (xout, GNMSTYLE "invisible");
                                        gsf_xml_out_add_cstr (xout, GNMSTYLE  "char", text);
+                                       odf_add_bool (xout, OFFICE "process-content", 1);
+                                       gsf_xml_out_add_cstr (xout, NULL, " ");
                                        gsf_xml_out_end_element (xout); /* </gnm:invisible> */
                                        g_free (text);
+                               } else {
+                                       ODF_OPEN_STRING;
+                                       g_string_append_len (accum, token + 1, len);
                                }
                        }
                        break;
-          
+               }
 
                case TOK_STRING: {
                        size_t len = strchr (token + 1, '"') - (token + 1);


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