Issue 120942 - Cell Number format style is changed after saving to ods by AOO
Summary: Cell Number format style is changed after saving to ods by AOO
Alias: None
Product: Calc
Classification: Application
Component: open-import (show other issues)
Version: 4.0.0-dev
Hardware: All All
: P3 Normal (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
Keywords: ms_interoperability
Depends on:
Blocks: 121014
  Show dependency tree
Reported: 2012-09-13 06:41 UTC by Li Feng Wang
Modified: 2015-12-11 17:20 UTC (History)
4 users (show)

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

sample file (41.00 KB, application/
2012-09-13 06:41 UTC, Li Feng Wang
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Li Feng Wang 2012-09-13 06:41:35 UTC
Created attachment 79467 [details]
sample file

AOO trunk r1381968

1)open sample file
2)check number format style in D65531
3)save to ods file
4)check number format style in D65531 too

number format style is changed, from ¥0300.000 to ¥300.000
Comment 1 Rainer Bielefeld 2013-08-31 11:22:22 UTC
I see several obscurities here, so back to UNCONFIRMED

a) Summary tells something concerning a save-export problem, but Component
   selction is "open-import"?
b) is this really a new 4.0.0 problem? I doubt
c) Because I did not understand all details here I submitted "Bug 123149 - "Add leading digits" formatting feature supported, but lost after save as .ods", what might describe the real roots of the observations here.
Comment 2 Edwin Sharp 2013-12-15 14:38:09 UTC
step 2) [BLUE]"¥"0#,##0.000;[RED]"¥"-0#,##0.000
step 4) [BLUE]"¥"#,#00.000;[RED]"¥-"#,#00.000

AOO410m1(Build:9750)  -  Rev. 1548193
2013-12-07_04:10:48 - Rev. 1548790
Comment 3 hanya 2013-12-15 15:27:17 UTC
Here are parts of stored styles in ods file that has the cell formatted with the format code in Comment 2.
From content.xml: 
   <table:table table:name="Sheet1" table:style-name="ta1" table:print="false">
    <table:table-column table:style-name="co1" table:default-cell-style-name="ce1"/>
    <table:table-row table:style-name="ro3">
     <table:table-cell office:value-type="float" office:value="100">

The cell formatted by "ce1" cell style and its this: 

<style:style style:name="ce1" style:family="table-cell" style:parent-style-name="Default" style:data-style-name="N111"/>

"N111" style is stored as follows: 

  <number:number-style style:name="N111P0" style:volatile="true">
   <style:text-properties fo:color="#0000ff"/>
   <number:number number:decimal-places="3" number:min-integer-digits="2" number:grouping="true"/>
  <number:number-style style:name="N111">
   <style:text-properties fo:color="#ff0000"/>
   <number:number number:decimal-places="3" number:min-integer-digits="2" number:grouping="true"/>
   <style:map style:condition="value()&gt;=0" style:apply-style-name="N111P0"/>

The above style can reproduce [BLUE]"¥"#,#00.000;[RED]"¥-"#,#00.000 style but 
it can not be the original formatting.

From [BLUE]"¥"0#,##0.000;[RED]"¥"-0#,##0.000 style, "min-integer-digits" is compacted to sequential two zero.
It seems number:number element could not represent the original number format.
See 16.27.2 <number:number-style> section of ODF 1.2 specification for the element.