To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=115227
                 Issue #|115227
                 Summary|Time value of DateTime cell is lost when loading Micro
                        |soft Excel 2003 XML(*.xml) file 
               Component|Spreadsheet
                 Version|OOO320m18
                Platform|Unknown
                     URL|
              OS/Version|Windows XP
                  Status|UNCONFIRMED
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P2
            Subcomponent|formatting
             Assigned to|spreadsheet
             Reported by|liyd





------- Additional comments from [email protected] Sun Oct 24 10:03:22 +0000 
2010 -------
Content of source file:
------------
<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
 xmlns:o="urn:schemas-microsoft-com:office:office"
 xmlns:x="urn:schemas-microsoft-com:office:excel"
 xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
 xmlns:html="http://www.w3.org/TR/REC-html40";>
 <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
  <Author>liyd</Author>
  <LastAuthor>liyd</LastAuthor>
  <Created>2010-10-24T07:33:39Z</Created>
  <Company></Company>
 </DocumentProperties>
 <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
  <WindowHeight>11625</WindowHeight>
  <WindowWidth>19185</WindowWidth>
  <WindowTopX>0</WindowTopX>
  <WindowTopY>90</WindowTopY>
  <ProtectStructure>False</ProtectStructure>
  <ProtectWindows>False</ProtectWindows>
 </ExcelWorkbook>
 <Styles>
  <Style ss:ID="Default" ss:Name="Normal">
   <Alignment ss:Vertical="Center"/>
   <Borders/>
   <Font ss:FontName="sans-serif" ss:Size="11" ss:Color="#000000"/>
   <Interior/>
   <NumberFormat/>
   <Protection/>
  </Style>
  <Style ss:ID="s62">
   <NumberFormat ss:Format="Short Date"/>
  </Style>
  <Style ss:ID="s63">
   <NumberFormat ss:Format="h:mm:ss"/>
  </Style>
  <Style ss:ID="s64">
   <NumberFormat ss:Format="General Date"/>
  </Style>
 </Styles>
 <Worksheet ss:Name="Sheet1">
  <Table ss:ExpandedColumnCount="3" ss:ExpandedRowCount="4" x:FullColumns="1"
   x:FullRows="1" ss:DefaultColumnWidth="54" ss:DefaultRowHeight="13.5">
   <Column ss:Index="3" ss:Width="110.25"/>
   <Row ss:Index="2">
    <Cell ss:Index="3" ss:StyleID="s62"><Data
ss:Type="DateTime">2010-10-24T00:00:00.000</Data></Cell>
   </Row>
   <Row>
    <Cell ss:Index="3" ss:StyleID="s63"><Data
ss:Type="DateTime">1899-12-31T15:33:52.000</Data></Cell>
   </Row>
   <Row>
    <Cell ss:Index="3" ss:StyleID="s64"><Data
ss:Type="DateTime">2010-10-24T15:33:58.000Z</Data></Cell>
   </Row>
  </Table>
  <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
   <PageSetup>
    <Header x:Margin="0.3"/>
    <Footer x:Margin="0.3"/>
    <PageMargins x:Bottom="0.75" x:Left="0.7" x:Right="0.7" x:Top="0.75"/>
   </PageSetup>
   <Selected/>
   <Panes>
    <Pane>
     <Number>3</Number>
     <ActiveRow>4</ActiveRow>
     <ActiveCol>2</ActiveCol>
    </Pane>
   </Panes>
   <ProtectObjects>False</ProtectObjects>
   <ProtectScenarios>False</ProtectScenarios>
  </WorksheetOptions>
 </Worksheet>
 <Worksheet ss:Name="Sheet2">
  <Table ss:ExpandedColumnCount="1" ss:ExpandedRowCount="1" x:FullColumns="1"
   x:FullRows="1" ss:DefaultColumnWidth="54" ss:DefaultRowHeight="13.5">
  </Table>
  <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
   <PageSetup>
    <Header x:Margin="0.3"/>
    <Footer x:Margin="0.3"/>
    <PageMargins x:Bottom="0.75" x:Left="0.7" x:Right="0.7" x:Top="0.75"/>
   </PageSetup>
   <ProtectObjects>False</ProtectObjects>
   <ProtectScenarios>False</ProtectScenarios>
  </WorksheetOptions>
 </Worksheet>
 <Worksheet ss:Name="Sheet3">
  <Table ss:ExpandedColumnCount="1" ss:ExpandedRowCount="1" x:FullColumns="1"
   x:FullRows="1" ss:DefaultColumnWidth="54" ss:DefaultRowHeight="13.5">
  </Table>
  <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
   <PageSetup>
    <Header x:Margin="0.3"/>
    <Footer x:Margin="0.3"/>
    <PageMargins x:Bottom="0.75" x:Left="0.7" x:Right="0.7" x:Top="0.75"/>
   </PageSetup>
   <ProtectObjects>False</ProtectObjects>
   <ProtectScenarios>False</ProtectScenarios>
  </WorksheetOptions>
 </Worksheet>
</Workbook>
------------

Using XCell#getFormula() to get formula of cell[C2,C3,C4], and get result:
------------
40475
0.648518518518519
40475
------------

Code to fetch applied format string:
------------
XTextFieldsSupplier text = (XTextFieldsSupplier)
UnoRuntime.queryInterface(XTextFieldsSupplier.class, XCell);
XPropertySet propetySet = (XPropertySet)
UnoRuntime.queryInterface(XPropertySet.class, text);
int nIndexKey = ((Integer) 
propetySet.getPropertyValue("NumberFormat")).intValue();
com.sun.star.beans.XPropertySet xProp = numberFormats.getByKey(nIndexKey);
String formatString = (String) xProp.getPropertyValue("FormatString");
System.out.println("FormatString: '" + formatString + "'");
-------------
and get result:
-------------
FormatString: 'D-M-YY'
FormatString: 'H:MM:SS'
FormatString: 'YYYY-M-D H:MM'
-------------

So the DateTime format is recognized, but the value is wrong.
Value of C4 is supposed to be 40475.648587962962963, but actually is 40475.

The bug can be detected by the following way:
1.create a new calc spreadsheet, create a DateTime cell.
2.save it in type "Microsoft Excel 2003 XML(.xml)".
3.open the xml file using text edit, the value is correct.
4.open the xml file using calc, and the time part is lost.

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to