Bug 610372 - Floating point values in ODF
Floating point values in ODF
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: import/export OOo / OASIS
git master
Other All
: Normal minor
: ---
Assigned To: Andreas J. Guelzow
Jody Goldberg
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2010-02-18 16:08 UTC by Morten Welinder
Modified: 2010-02-18 22:13 UTC (History)
0 users

See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (2.85 KB, patch)
2010-02-18 20:32 UTC, Andreas J. Guelzow
none Details | Diff | Review
proposed patch (811 bytes, patch)
2010-02-18 20:42 UTC, Andreas J. Guelzow
none Details | Diff | Review

Description Morten Welinder 2010-02-18 16:08:47 UTC
I notice this:

		case VALUE_STRING:
			gsf_xml_out_add_float (state->xml, OFFICE "value",
					       value_get_as_float
					       (cell->value),
					       -1);
			break;

gsf_xml_out_add_float isn't the right function to use here.  For one thing,
it knows nothing about gnm_float.  For another, it does not know about
output convensions.

Something built on top of value_get_as_gstring should be used.

Also, the switch statement around here doesn't seem to handle VALUE_EMPTY.
Comment 1 Morten Welinder 2010-02-18 16:33:10 UTC
Similarly odf_write_filter_cond should use value_get_as_gstring, not
value_get_as_string.
Comment 2 Andreas J. Guelzow 2010-02-18 18:21:05 UTC
What do output conventions have to do with this?
Comment 3 Andreas J. Guelzow 2010-02-18 18:40:27 UTC
So we should be doing something like in xlsx?

} else if (val->type != VALUE_BOOLEAN) {
		content = value_get_as_string (cell->value);
		gsf_xml_out_add_cstr (xml, NULL, content);
		g_free (content);
} else
Comment 4 Morten Welinder 2010-02-18 19:12:59 UTC
nah, we should fix xlsx too...

Output conventions determine floating point format.  Number of digits at
present.
Comment 5 Andreas J. Guelzow 2010-02-18 20:32:03 UTC
Created attachment 154172 [details] [review]
proposed patch

Proposed patch to fix this issue for the ODF exporter.
Comment 6 Andreas J. Guelzow 2010-02-18 20:42:55 UTC
Created attachment 154173 [details] [review]
proposed patch

proposed patch to fix the xlsx case
Comment 7 Andreas J. Guelzow 2010-02-18 22:13:50 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.

Note You need to log in before you can comment on or make changes to this bug.