Issue 104320 - [ODF] Calc fails to load number format which has three conditions, produced by Gnumeric
Summary: [ODF] Calc fails to load number format which has three conditions, produced b...
Alias: None
Product: Calc
Classification: Application
Component: formatting (show other issues)
Version: OOO310m9
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
Keywords: oooqa
Depends on:
Reported: 2009-08-18 17:36 UTC by aguelzow
Modified: 2017-05-20 11:35 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---

sample file (4.55 KB, application/vnd.oasis.opendocument.spreadsheet)
2009-08-18 17:37 UTC, aguelzow
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description aguelzow 2009-08-18 17:36:35 UTC
This has been observed in OOO310m11 but this version does not exist in the
"Found in version" selection.

I will be attaching an ODF file that contains 2 cells (A1,A2) with conditional
data formatting. Calc fails to read that conditional format.
Comment 1 aguelzow 2009-08-18 17:37:24 UTC
Created attachment 64240 [details]
sample file
Comment 2 Regina Henschel 2009-08-18 20:51:19 UTC
I do not find any conditional formatting in the source. Is your issue about a
custom number format?
Comment 3 aguelzow 2009-08-18 22:31:00 UTC
I am talking about the conditional number style
<number:number-style style:name="NDC-0">      
<style:map style:condition="value()&gt;0.000000" style:apply-style-name="ND.0"/>
      <style:map style:condition="value()&lt;0.000000"
      <style:map style:condition="value()=0.000000" style:apply-style-name="ND00"/>
which is applied to A1 and A2 and should show positive numbers green and
negative ones red. 
Comment 4 Regina Henschel 2009-08-18 23:48:21 UTC
I have adapted the summary.

I can reproduce the error with OOO310m18 on WinXP with the attached document or
any other document produced in Gnumeric. The structure of the file looks the
same as those saved by OOo, so I guess, that it is a valid file.
Comment 5 ooo 2010-06-18 12:55:28 UTC
Note: in DEV300_m82 when opening the document a dialog pops up that the
document is corrupted and offers to repair the file. Attempting to
modify the zip using Info-ZIP Zip 2.32 gave

        zip warning: local and central headers differ for (null)
        zip warning:  offset 2--local = 00, central = 08
zip error: Zip file structure invalid (ooo-test-gnm.ods)

Actually the number format in question is

    <number:number-style style:name='NDC-0'>
      <style:map style:condition='value()&gt;0.000000' style:apply-style-name='ND.0' />
      <style:map style:condition='value()&lt;0.000000' style:apply-style-name='ND-0' />
      <style:map style:condition='value()=0.000000' style:apply-style-name='ND00' />

that is three conditions, with the third being superfluous, anything not
<0 and not >0 is 0 (or text). Calc internally does not support more than
2 conditions, Excel doesn't either.

OOo stores such a format as

    <number:number-style style:name='N116'>
      <number:number number:min-integer-digits='2' number:decimal-places='0' number:grouping='true' />
      <style:map style:condition='value()&gt;0' style:apply-style-name='N116P0' />
      <style:map style:condition='value()&lt;0' style:apply-style-name='N116P1' />

Note the <number:number> format augmented by <style:map style:condition=...>

I tried with Gnumeric 1.8.4 to use number format
The format is accepted, but values don't display at all, neither positive, nor negative nor zero. Removing the third condition leaving
it works.

Certainly not a P2 issue.
Comment 6 Marcus 2017-05-20 11:35:10 UTC
Reset assigne to the default "".