GNOME Bugzilla – Bug 672489
ODF formats with default conditions
Last modified: 2012-03-21 13:44:33 UTC
../src/ssconvert ../samples/excel/lookfuns.xls /tmp/lookfuns.ods ./ttt.pl /tmp/lookfuns.ods - <gnm:Style ... Format=""$"#,##0;[<0][Red]"($"#,##0)"> + <gnm:Style ... Format="[>0]"$"#,##0;[<0][Red]"($"#,##0)"> It looks like ODF export/import likes to add conditions. That isn't outright wrong, but at least strange.
We are changing from "$"#,##0;[<0][Red]"($"#,##0) to [>0]"$";#,##0;[<0][Red]"($"#,##0) The first format implies a condition of [>0] on the first item, so this is equivalent. I will need to have a look how this looks like inside the ODF files.
In /tmp/lookfuns.ods we have <number:number-style style:name="NDC-0"> <style:map style:condition="value()>=0" style:apply-style-name="ND.3"/> <style:map style:condition="value()<0" style:apply-style-name="ND-0"/> </number:number-style> while after saving it again, this became: <number:number-style style:name="NDC-0"> <style:map style:condition="value()>0" style:apply-style-name="ND.3"/> <style:map style:condition="value()<0" style:apply-style-name="ND-0"/> </number:number-style> Note that the difference is >=0 vs >0
This number style is part of cell style ACE-0x81e8448 which is used only once: <table:table-cell table:style-name="ACE-0x81e8448" office:value-type="string"><text:p>B20</text:p></table:table-cell> for cell A14. The original format in the xls file is: "$"#,##0_);[Red]\("$"#,##0\) This is already loaded incorrectly from the first file. The format becomes: "$"#,##0;[<0][Red]"($"#,##0) Note that the original "$"#,##0_);[Red]\("$"#,##0\) formats the value 0 as '$0', on the other hand "$"#,##0;[<0][Red]"($"#,##0) formats the value 0 as '0'.
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. Morten, please rerun the test to see whether it is indeed fixed.
"Pass"