Issue 104320

Summary: [ODF] Calc fails to load number format which has three conditions, produced by Gnumeric
Product: Calc Reporter: aguelzow <aguelzow>
Component: formattingAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: issues, ooo, rb.henschel
Version: OOO310m9Keywords: oooqa
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
sample file none

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:apply-style-name="ND-0"/>
      <style:map style:condition="value()=0.000000" style:apply-style-name="ND00"/>
    </number:number-style>
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' />
    </number:number-style>

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' />
    </number:number-style>

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


I tried with Gnumeric 1.8.4 to use number format
[>0][Green]#,#00;[<0][Red]-#,#00;[=0]#,#00
The format is accepted, but values don't display at all, neither positive, nor negative nor zero. Removing the third condition leaving
[>0][Green]#,#00;[<0][Red]-#,#00;#,#00
it works.

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