GNOME Bugzilla – Bug 725453
Reading from xls introduces value formats
Last modified: 2014-03-01 18:12:49 UTC
Excel doesn't have value formats, only cell formats, so reading xls files shouldn't come up with value formats, except perhaps to emulate something weird I cannot think of right now. 1. New Gnumeric 2. A1=2 3. Format A1 as 0.00 4. Save as x.gnumeric 5. Save as x.xls 6. ssdiff --xml x.gnumeric x.xls <ssdiff:Cell Row="2" Col="0" OldValueType="40" Old="2" NewValueType="40" NewValueFormat="0.00" New="2"/> The code responsible for this is a bit old: commit 167c36d3c506a091ea304e693a26ff7810914866 Author: Jody Goldberg <jody@gnome.org> Date: Mon Feb 4 03:20:04 2002 +0000 although it has been moved a good deal back and forth, left and right, gotten duplicated, and gotten de-duplicated since then.
I think I can see the reason why this was done: An xls producer could use the format present in the value record to set the format without having a style record that covers the cell. We must, therefore, apply the format somehow. Doing style changes cell-by-cell would chop up the quad-tree. That could be expensive. Also, back in 2002 we did not have cover to undo the chopping-up. Note: booleans and empties cannot have value formats, so the mechanism hasn't actually worked for those for ~6 years. Note: the code also shies away from using this mechanism for "non-simple" formats. Those are formats with conditions in them. I have no idea why.
Patched in my tree. Will commit later.