[gnumeric] fix GENERAL roundtrip through ODF



commit 46972ee785be1801770a4e74abca256d20eec3b6
Author: Andreas J. Guelzow <aguelzow pyrshep ca>
Date:   Mon Mar 31 08:27:25 2014 -0600

    fix GENERAL roundtrip through ODF
    
    2014-03-31  Andreas J. Guelzow <aguelzow pyrshep ca>
    
        * openoffice-read.c (odf_number): try to recognize LO's GENERAL

 plugins/openoffice/ChangeLog         |    4 ++++
 plugins/openoffice/openoffice-read.c |   10 +++++-----
 2 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index 0fe4e3c..545c6eb 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,5 +1,9 @@
 2014-03-31  Andreas J. Guelzow <aguelzow pyrshep ca>
 
+       * openoffice-read.c (odf_number): try to recognize LO's GENERAL
+
+2014-03-31  Andreas J. Guelzow <aguelzow pyrshep ca>
+
        * openoffice-read.c (odf_embedded_text_end): remove print statement
        (oo_date_text_append): cover '"'
 
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index d8190ca..d45dadd 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -5108,7 +5108,7 @@ odf_number (GsfXMLIn *xin, xmlChar const **attrs)
        OOParseState *state = (OOParseState *)xin->user_state;
        gboolean grouping = FALSE;
        int decimal_places = 0;
-       gboolean vals_specified = FALSE;
+       gboolean decimals_specified = FALSE;
 /*     gnm_float display_factor = 1.; */
        int min_i_digits = 1;
 
@@ -5119,17 +5119,17 @@ odf_number (GsfXMLIn *xin, xmlChar const **attrs)
 
        for (; attrs != NULL && attrs[0] && attrs[1] ; attrs += 2)
                if (oo_attr_bool (xin, attrs, OO_NS_NUMBER, "grouping", &grouping))
-                       vals_specified = TRUE;
+                       ;
                else if (oo_attr_int_range (xin, attrs, OO_NS_NUMBER, "decimal-places", &decimal_places, 0, 
30)) {
-                       vals_specified = TRUE;
+                       decimals_specified = TRUE;
                } /* else if (gsf_xml_in_namecmp (xin, CXML2C (attrs[0]), OO_NS_NUMBER,  */
 /*                                            "display-factor")) */
 /*                     display_factor = gnm_strto (CXML2C (attrs[1]), NULL); */
                else if (oo_attr_int_range (xin, attrs, OO_NS_NUMBER,
                                              "min-integer-digits", &min_i_digits, 0, 30))
-                       vals_specified = TRUE;
+                       ;
 
-       if (vals_specified)
+       if (decimals_specified || (min_i_digits != 1) || grouping)
                go_format_generate_number_str (state->cur_format.accum,  min_i_digits, decimal_places,
                                               grouping, FALSE, FALSE, NULL, NULL);
        else


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