[gnumeric] ods: deal with bogus Print_Area from XL.



commit 41cd75289605c2788829223967c19365168b810a
Author: Morten Welinder <terra gnome org>
Date:   Thu Oct 12 11:53:32 2017 -0400

    ods: deal with bogus Print_Area from XL.

 plugins/openoffice/ChangeLog         |    5 +++++
 plugins/openoffice/openoffice-read.c |   12 ++++++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/plugins/openoffice/ChangeLog b/plugins/openoffice/ChangeLog
index a1e7074..0d7d5de 100644
--- a/plugins/openoffice/ChangeLog
+++ b/plugins/openoffice/ChangeLog
@@ -1,3 +1,8 @@
+2017-10-12  Morten Welinder  <terra gnome org>
+
+       * openoffice-read.c (oo_named_expr_common): Deal with bogus
+       Print_Area in XL generated files.
+
 2017-10-10  Andreas J. Guelzow <aguelzow pyrshep ca>
 
        * openoffice-read.c (oo_plot_series): instead of glueing value ranges together use
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index 9003dee..3fd312a 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -7807,10 +7807,11 @@ oo_named_expr_common (GsfXMLIn *xin, xmlChar const **attrs, gboolean preparse)
                        scope = CXML2C (attrs[1]);
 
 #if 0
-       g_printerr ("%s: %s [sheet=%s]\n",
+       g_printerr ("%s: %s [sheet=%s] [%s]\n",
                    (preparse ? "preparse" : "parse"),
                    name,
-                   state->pos.sheet ? state->pos.sheet->name_unquoted : "-");
+                   state->pos.sheet ? state->pos.sheet->name_unquoted : "-",
+                   expr_str);
 #endif
 
        if (preparse) {
@@ -7818,6 +7819,13 @@ oo_named_expr_common (GsfXMLIn *xin, xmlChar const **attrs, gboolean preparse)
                base_str = NULL;
        }
 
+       if (name && expr_str &&
+           g_str_equal (name, "Print_Area") &&
+           g_str_equal (expr_str, "of:=[.#REF!]")) {
+               // Deal with XL nonsense
+               expr_str = NULL;
+       }
+
        if (name != NULL && expr_str != NULL) {
                GnmParsePos   pp;
                GnmExprTop const *texpr;


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