[gnumeric] odf: handle named expressions without an expression.



commit a71564f9dbd781c7355c0c7549401ab0d2ddabba
Author: Morten Welinder <terra gnome org>
Date:   Sun Mar 30 18:33:25 2014 -0400

    odf: handle named expressions without an expression.
    
    That's probably not up to spec, but LO generates that.

 plugins/openoffice/ChangeLog         |    1 +
 plugins/openoffice/openoffice-read.c |    9 ++++++---
 2 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index a93b913..819937c 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -3,6 +3,7 @@
        * openoffice-read.c (odf_number_color): Use new go_format_palette_
        functions.  This also handles approximate matches.
        (openoffice_file_open): Plug leak.
+       (oo_named_expr): If the expression is missing, substitute #REF.
 
 2014-03-29  Morten Welinder  <terra gnome org>
 
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index 4e376d0..8ce769e 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -7241,9 +7241,12 @@ oo_named_expr (GsfXMLIn *xin, xmlChar const **attrs)
                        if (*expr_str == '=')
                                expr_str++;
 
-                       texpr = oo_expr_parse_str (xin, expr_str,
-                                                  &pp, GNM_EXPR_PARSE_DEFAULT,
-                                                  f_type);
+                       if (*expr_str == 0)
+                               texpr = gnm_expr_top_new_constant (value_new_error_REF (NULL));
+                       else
+                               texpr = oo_expr_parse_str (xin, expr_str,
+                                                          &pp, GNM_EXPR_PARSE_DEFAULT,
+                                                          f_type);
                        if (texpr != NULL) {
                                pp.sheet = state->pos.sheet;
                                if (pp.sheet == NULL && scope != NULL)


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