Bug 62250 - VIEWING: After open xml file the cell value is NaN instead 0
Summary: VIEWING: After open xml file the cell value is NaN instead 0
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.0.1.2 release
Hardware: All All
: medium minor
Assignee: Eike Rathke
URL:
Whiteboard: BSA target:4.4.0 target:4.3.0 target:...
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-12 17:54 UTC by Ruslan Fatakhov
Modified: 2014-07-11 12:24 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Original file from bud 44969 arhive 7zip (18.63 KB, application/x-7z-compressed)
2013-03-12 17:54 UTC, Ruslan Fatakhov
Details
File opened with openoffice and save like ods (48.22 KB, application/vnd.oasis.opendocument.spreadsheet)
2013-03-12 17:56 UTC, Ruslan Fatakhov
Details
File opend with libreCalc 4.0.1 and save like ods (45.74 KB, application/vnd.oasis.opendocument.spreadsheet)
2013-03-12 17:57 UTC, Ruslan Fatakhov
Details
Screenshot- OpenOffice left, LibreOffice right (261.63 KB, image/png)
2013-04-09 10:18 UTC, Jorendc
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ruslan Fatakhov 2013-03-12 17:54:46 UTC
Created attachment 76412 [details]
Original file from bud 44969 arhive 7zip

Problem description: 
After open xml file i can to see NaN instead 0. I chack file from bug 44969. I can open it, but instead 0 i see NaN. I open one by Apache Openoffice 3.4.1. It viewing correctly.
Steps to reproduce:
1. Open xml file 11111111111111111111.xml with LibreCalc 4.0.1.2
2. Save one like libreoffice 4.0.1.ods
3. Open one with Apache Openoffice 3.4.1
4. Save one like apachiopenoffice3.4.1.ods

Current behavior:
In fields displayed Nan instead of 0

Expected behavior:
Prior release 4.0 Calc couldn't to open one.

              
Operating System: Ubuntu
Version: 4.0.1.2 release
Comment 1 Ruslan Fatakhov 2013-03-12 17:56:28 UTC
Created attachment 76413 [details]
File opened with openoffice and save like ods

File opened with openoffice and save like ods
Comment 2 Ruslan Fatakhov 2013-03-12 17:57:43 UTC
Created attachment 76414 [details]
File opend with libreCalc 4.0.1 and save like ods

File opend with libreCalc 4.0.1 and save like ods
Comment 3 Jorendc 2013-04-09 10:17:18 UTC
Thanks for reporting

I can reproduce this behavior using Mac OSX 10.8.3 with LibreOffice Version 4.0.2.2 (Build ID: 4c82dcdd6efcd48b1d8bba66bfe1989deee49c3)
TinderBox: MacOSX TDF Release, Branch:libreoffice-4-0, Time: 2013-03-26_15:52:16. A recalculation doesn't solve anything, the cells still contains "N,aN". Opening this file using OpenOffice 3.4.1 shows the cell content is "0".

Therefore I mark this bug as NEW.

Priority:
Minor: does make it substantially harder to create high quality work
medium: default priority for minor bugs.

Kind regards,
Joren
Comment 4 Jorendc 2013-04-09 10:18:29 UTC
Created attachment 77657 [details]
Screenshot- OpenOffice left, LibreOffice right
Comment 5 Jorendc 2013-04-09 10:26:14 UTC
By digging into the xml file I see following line (see screenshot). This is the first line of the spreadsheet (row 5).

   <Row ss:AutoFitHeight="0" ss:Height="15">
    <Cell ss:StyleID="s23"><Data ss:Type="String">10</Data></Cell>
    <Cell ss:StyleID="s24"><Data ss:Type="String">KZT</Data></Cell>
    <Cell ss:StyleID="s24"><Data ss:Type="String">Кредитовое авизо</Data></Cell>
    <Cell ss:StyleID="s24"><Data ss:Type="String">Основная деятельность</Data></Cell>
    <Cell ss:StyleID="s24"><Data ss:Type="String">103946</Data></Cell>
    <Cell ss:StyleID="s24"><Data ss:Type="String">103945</Data></Cell>
    <Cell ss:StyleID="s24"><Data ss:Type="String">Дебиторы</Data></Cell>
    <Cell ss:StyleID="s25"><Data ss:Type="String">09.09.2011</Data></Cell>
    <Cell ss:StyleID="s27"><Data ss:Type="Number">925044.62</Data></Cell>
    <Cell ss:StyleID="s28"><Data ss:Type="Number"></Data></Cell>
   </Row>

As you can see, the last Cell tag doesn't contain data. Therefore there is nothing available (NaN). OpenOffice shows this as a zero, LibreOffice shows it how it is ... it doesn't contain data. I don't know which behavior is technically the best for this cases.

I'll ask a core developer to have a look at this.

Kind regards,
Joren
Comment 6 Jorendc 2013-04-09 10:56:17 UTC
A core developer recommended me to have a look at the behavior of Excel.
I openened the attached file using Excel for Mac 2011 and it shows a '0,00'. So OpenOffice has the 'good' behavior too. 

kind regards,
Joren
Comment 7 Eike Rathke 2014-07-09 17:24:45 UTC
It's best to treat this "empty number cell" case from a file format similar to an empty cell that is used in calculations, where it is treated as zero. Having already a (even if maybe technically correct) NaN set also disallows calculations with that value, and applying number formats to a Nan may generate unexpected display strings.
Comment 8 Commit Notification 2014-07-09 17:26:22 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=fea6f83df8d2183b108695217bc4ff7a93e942c9

resolved fdo#62250 absent value cell values are not NaN, set to 0.0



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 9 Eike Rathke 2014-07-09 17:55:41 UTC
Pending review
for 4-3 at https://gerrit.libreoffice.org/10174
for 4-3-0 at https://gerrit.libreoffice.org/10175
for 4-2 at https://gerrit.libreoffice.org/10176
Comment 10 Commit Notification 2014-07-09 18:11:21 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-4-3-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=068a7035bf679ba1b9650777cae327a18d3ee519&h=libreoffice-4-3-0

resolved fdo#62250 absent value cell values are not NaN, set to 0.0


It will be available already in LibreOffice 4.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2014-07-09 18:16:12 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-4-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=cd8acfacdc02dc6dbfc6a73ef64c5bec8eefebf4&h=libreoffice-4-3

resolved fdo#62250 absent value cell values are not NaN, set to 0.0


It will be available in LibreOffice 4.3.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 12 Commit Notification 2014-07-09 18:17:52 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=4e69127246028f72eee6279e9a810bb865ce654c&h=libreoffice-4-2

resolved fdo#62250 absent value cell values are not NaN, set to 0.0


It will be available in LibreOffice 4.2.7.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 13 Kevin Suo 2014-07-11 11:26:11 UTC
Is Bug 79249 related?
Comment 14 Eike Rathke 2014-07-11 12:24:43 UTC
No.