Commit 587388f9 authored by Morten Welinder's avatar Morten Welinder
Browse files

ods: fix import problem with crazy named expressions.

"19" as a name was throwing us off.
parent c9f96e0d
......@@ -20,6 +20,7 @@ Morten:
* Fix ssconvert sheet selection for csv. [#555]
* Test suite improvements.
* Fix ods import problem with irregular sheet sizes.
* Fix ods import problem with crazy named expressions. [#557]
--------------------------------------------------------------------------
Gnumeric 1.12.48
......
......@@ -2074,8 +2074,22 @@ odf_fix_en_collect (G_GNUC_UNUSED gconstpointer key_,
here[i] = '_';
}
}
// If the name is inherently invalid ("19" as in #557) then mangle
// it first.
if (!expr_name_validate (str->str)) {
g_string_insert (str, 0, "NAME");
if (!expr_name_validate (str->str)) {
char *p;
for (p = str->str; *p; p++)
if (!g_ascii_isalnum (*p))
*p = 'X';
}
}
while (!odf_fix_en_validate (str->str, fen))
g_string_append_c (str, '_');
odf_fix_expr_names_t_add (fen, name, g_string_free (str, FALSE));
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment