After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 735298 - Color axis name saved without xml encoding
Color axis name saved without xml encoding
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: Charting
1.12.x
Other Linux
: Normal normal
: ---
Assigned To: Jean Bréfort
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2014-08-23 20:42 UTC by Kingsley G. Morse Jr.
Modified: 2014-08-28 02:31 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Kingsley G. Morse Jr. 2014-08-23 20:42:56 UTC
Gnumeric is proving to be a handy application for statistically screening data.

Thank you very much for maintaining and developing it.

I happened to notice that using the "&" character in the name of a custom color map for the Color-Axis of an XYZ matrix prevented gnumeric from loading the workbook file.

When I typed something like

 $ gnumeric corrupted_workbook.gnumeric 

gnumeric complained with 

    (gnumeric:8740): XML-CRITICAL **: xmlParseEntityRef: no name


    ** (gnumeric:8740): WARNING **: Document likely damaged.

    ** (gnumeric:8740): WARNING **: leaking extensions

I uncompressed the workbook's XML with

    $ gunzip -c  tmp/corrupted_workbook.gnumeric > tmp/corrupted_workbook.xml

and found the corrupted line with

    $ xmlcopyeditor tmp/corrupted_workbook.xml

xmlcopyeditor said

    "Error a"Error at line 1866967, column 24: not well-formed (invalid token)"t line 1866967, column 24: not well-formed (invalid token)"

Line 1866967 contained

    <name>10% worst & best</name>

Column 24 holds the space character after the "&".

"10% worst & best" is the name I chose for a custom color map for the Color-Axis of an XYZ matrix.

The xml suggests to me that gnumeric considers this a so called "GogAxisColorMap".

I'm happy to report that replacing the "&" with "and" in the xml allowed gnumeric to load the file.

Maybe gnumeric's dialog for naming custom color maps should stop users from entering "&"s.

Thanks again,
Kingsley
Comment 1 Andreas J. Guelzow 2014-08-24 00:42:58 UTC
There is nothing wrong with having a '&' in a name. The problem seems to be it is not correctly encoded when written to the file.
Comment 2 Andreas J. Guelzow 2014-08-24 00:49:53 UTC
in gog-axis-color-map.c inside save_name_cb we have gsf_xml_out_add_cstr_unchecked (output, NULL, name);
which writes the name without escaping characters in it. THat should be
gsf_xml_out_add_cstr (output, NULL, name);
Comment 3 Morten Welinder 2014-08-27 01:59:35 UTC
Jean, do you agree with the analysis?
Comment 4 Jean Bréfort 2014-08-27 13:39:19 UTC
Morten, sure, I missed that. Andreas, please commit.
Comment 5 Andreas J. Guelzow 2014-08-28 02:31:11 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.