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 672489 - ODF formats with default conditions
ODF formats with default conditions
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: import/export OOo / OASIS
git master
Other All
: Normal normal
: ---
Assigned To: Andreas J. Guelzow
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2012-03-20 18:01 UTC by Morten Welinder
Modified: 2012-03-21 13:44 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Morten Welinder 2012-03-20 18:01:55 UTC
../src/ssconvert ../samples/excel/lookfuns.xls /tmp/lookfuns.ods
./ttt.pl /tmp/lookfuns.ods 

-          <gnm:Style ... Format="&quot;$&quot;#,##0;[&lt;0][Red]&quot;($&quot;#,##0)">
+          <gnm:Style ... Format="[&gt;0]&quot;$&quot;#,##0;[&lt;0][Red]&quot;($&quot;#,##0)">

It looks like ODF export/import likes to add conditions.  That isn't outright
wrong, but at least strange.
Comment 1 Andreas J. Guelzow 2012-03-20 21:52:13 UTC
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.
Comment 2 Andreas J. Guelzow 2012-03-21 05:47:11 UTC
In /tmp/lookfuns.ods we have
<number:number-style style:name="NDC-0">
      <style:map style:condition="value()&gt;=0" style:apply-style-name="ND.3"/>
      <style:map style:condition="value()&lt;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()&gt;0" style:apply-style-name="ND.3"/>
      <style:map style:condition="value()&lt;0" style:apply-style-name="ND-0"/>
</number:number-style>

Note that the difference is &gt;=0 vs &gt;0
Comment 3 Andreas J. Guelzow 2012-03-21 05:59:43 UTC
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'.
Comment 4 Andreas J. Guelzow 2012-03-21 07:13:00 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.

Morten, please rerun the test to see whether it is indeed fixed.
Comment 5 Morten Welinder 2012-03-21 13:44:33 UTC
"Pass"