Download it now!
Bug 52205 - EDITING: Regression: reference to CSV becomes a string, not an integer
Summary: EDITING: Regression: reference to CSV becomes a string, not an integer
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.6.0.1 rc
Hardware: Other All
: medium normal
Assignee: Eike Rathke
URL:
Whiteboard: BSA target:3.7.0 target:3.6.0
Keywords: regression
Depends on:
Blocks: mab3.6
  Show dependency treegraph
 
Reported: 2012-07-17 15:26 UTC by Yi Ding
Modified: 2012-08-29 15:20 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
csv file (4 bytes, text/csv)
2012-07-17 15:27 UTC, Yi Ding
Details
test.ods (7.70 KB, application/vnd.oasis.opendocument.spreadsheet)
2012-07-17 15:27 UTC, Yi Ding
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yi Ding 2012-07-17 15:26:55 UTC
Problem description: 

I'm referencing a CSV from a ODS file.  In 3.5.4, I'm able to then use the value in an if statement in another cell and treat it as a numeric value.  In 3.6.0rc1 however, the IF statement only returns true if I treat it as a string.

I've attached sample CSV and ODS files.  You'll need to update the link to get it to work on your system.

Related note: in excel, it looks like they have a different format for links from CSVs (where they don't use Sheet1) and libreoffice doesn't support XLS files with that format.

Platform (if different from the browser): 
              
Windows 7, x86_64
Comment 1 Yi Ding 2012-07-17 15:27:25 UTC
Created attachment 64321 [details]
csv file
Comment 2 Yi Ding 2012-07-17 15:27:58 UTC
Created attachment 64322 [details]
test.ods
Comment 3 Yi Ding 2012-07-17 15:32:24 UTC
I don't know what the protocol is for assigning importance on bugs, but this would make it impossible for us to upgrade to 3.6 because it would break existing documents.
Comment 4 Tomaz Vajngerl 2012-07-17 19:37:46 UTC
At update I check "Detect special numbers" and then it worked as expected.
Comment 5 Yi Ding 2012-07-17 19:46:29 UTC
Very interesting.  "Detect special numbers" isn't required in 3.5.x and from this document (sorry I couldn't find the corresponding libreoffice doc)

http://wiki.services.openoffice.org/wiki/Calc/Features/Numbers_import_for_plain_text_files#Detect_special_numbers

it looks like that option is meant for detecting dates, times, and scientific notation.

So it looks like it's an issue in the numeric detection code then?
Comment 6 Eike Rathke 2012-07-17 22:14:04 UTC
I'm taking this. Simply opening the attached test.csv file already reveals the bug.
Comment 7 Kohei Yoshida 2012-07-18 13:01:11 UTC
This may be my bug.  I did change ScColumn's number detection pattern which probably affected csv import.
Comment 8 Kohei Yoshida 2012-07-18 13:09:06 UTC
c.f. Bug 43109
Comment 9 Kohei Yoshida 2012-07-18 13:30:04 UTC
The problem was that, our simple number parser would recognize a string like '0000234' as a valid number, whereas we needed that to be recognized as text in the pivot table code.  One way to fix this is to remove my change, then modify the simple number parser to treat number with preceding zeros as text (if that's indeed a desirable behavior).  If not, then introducing another flag to special case the pivot table case, but having too many flags may make the code harder to maintain...
Comment 10 Not Assigned 2012-07-19 16:29:36 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

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

resolved fdo#52205 do not force all text cells in CSV import
Comment 11 Not Assigned 2012-07-20 13:22:16 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-3-6":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6945d1eb7666f90b6b356f97d368c87664c77d88&g=libreoffice-3-6

resolved fdo#52205 do not force all text cells in CSV import


It will be available in LibreOffice 3.6.1.
Comment 12 Not Assigned 2012-07-20 19:18:07 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-3-6-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=9581ccc83e472d17f10051b7cc9e6b5f36f120ce&g=libreoffice-3-6-0

resolved fdo#52205 do not force all text cells in CSV import


It will be available already in LibreOffice 3.6.0.
Comment 13 Petr Mladek 2012-07-23 13:54:26 UTC
The fix is even in the 3-6-0 branch. I guess that we could close this bug now :-)