[gnumeric] .gnumeric: turn unparsable expressions into strings.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] .gnumeric: turn unparsable expressions into strings.
- Date: Wed, 14 Jan 2015 17:55:56 +0000 (UTC)
commit d6f3a4d5459d41bf819d447e511510faa78ef636
Author: Morten Welinder <terra gnome org>
Date: Wed Jan 14 12:55:02 2015 -0500
.gnumeric: turn unparsable expressions into strings.
We have no good way out, but turning expressions into strings is less
lossy than dropping them on the floor.
ChangeLog | 6 ++++++
src/xml-sax-read.c | 14 +++++++-------
2 files changed, 13 insertions(+), 7 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 63cca47..7555b85 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-01-14 Morten Welinder <terra gnome org>
+
+ * src/xml-sax-read.c (xml_sax_cell_content): When we fail to parse
+ an expresssion, make it a string instead of dropping it on the
+ floor.
+
2015-01-13 Morten Welinder <terra gnome org>
* src/xml-sax-read.c (xml_sax_cell_content): When we discover a
diff --git a/src/xml-sax-read.c b/src/xml-sax-read.c
index d661a3a..fe5b583 100644
--- a/src/xml-sax-read.c
+++ b/src/xml-sax-read.c
@@ -2086,17 +2086,17 @@ xml_sax_cell_content (GsfXMLIn *xin, G_GNUC_UNUSED GsfXMLBlob *blob)
GNM_EXPR_PARSE_DEFAULT,
state->convs,
&perr);
- if (texpr && cell) {
+ if (!texpr) {
+ g_warning ("Unparsable expression for %s: %s\n",
+ cell ? cell_name (cell) : "-",
+ content);
+ texpr = gnm_expr_top_new_constant (value_new_string
(expr_start));
+ }
+ if (cell) {
gnm_cell_set_expr (cell, texpr);
gnm_expr_top_unref (texpr);
} else if (texpr)
cc->texpr = texpr;
- else {
- g_warning ("Unparsable expression for %s: %s\n",
- cell_name (cell),
- content);
- gnm_cell_set_value (cell, value_new_string (content));
- }
parse_error_free (&perr);
} else if (cell)
gnm_cell_set_text (cell, content);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]