Bug 76836 - Wrong display with text format applied to numeric cells
Summary: Wrong display with text format applied to numeric cells
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Eike Rathke
URL:
Whiteboard: target:5.3.0 target:7.3.0
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-31 14:01 UTC by Philipp Tobler
Modified: 2021-11-18 18:24 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
test file (15.09 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-03-31 14:01 UTC, Philipp Tobler
Details
test export (30 bytes, text/csv)
2014-03-31 14:01 UTC, Philipp Tobler
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Tobler 2014-03-31 14:01:22 UTC
Created attachment 96659 [details]
test file

Trying to export a table as CSV containing IP addresses generated using "Format Cells..."
The string added in the format string "192.168.0."@ is not added in the CSV file. See attached examples.

Could this bug be linked to 73836?

Cheers
Philipp
Comment 1 Philipp Tobler 2014-03-31 14:01:46 UTC
Created attachment 96660 [details]
test export
Comment 2 Tomaz Vajngerl 2014-03-31 14:20:57 UTC
I think the correct format should be "192.168.0."#

Still.. I'm not sure if this is a bug or not and what the bug is. In Excel "192.168.0."@ is invalid...
Comment 3 Urmas 2014-03-31 18:24:18 UTC
Indeed, the cells are not saved in the way Excel does.
Also, "prefix"@ is a valid Excel format.
Comment 4 Tomaz Vajngerl 2014-03-31 18:59:25 UTC
(In reply to comment #3)
> Also, "prefix"@ is a valid Excel format.

"prefix"@ works only when cell content is text.. not numbers, like in this case
Comment 5 Philipp Tobler 2014-04-01 06:45:29 UTC
Interesting:
- using Format Category Text and Format code "192.168.0."@ shows correctly formatted values in the table, but only the original value of the cells are exported to the CSV
- using Format Category Number and Format code "192.168.0."# shows correctly formatted values both in the table and in the exported CSV

If this isn't a bug, its still unfortunate...
Comment 6 QA Administrators 2015-06-08 14:42:47 UTC Comment hidden (obsolete)
Comment 7 Buovjaga 2015-08-02 10:41:46 UTC
Repro.

Win 7 Pro 64-bit Version: 5.1.0.0.alpha1+
Build ID: 902255645328efde34ddf62227c8278e8dd61ff0
TinderBox: Win-x86@39, Branch:master, Time: 2015-07-30_03:52:07
Locale: en-US (fi_FI)
Comment 8 QA Administrators 2016-09-20 10:21:37 UTC Comment hidden (obsolete)
Comment 9 Dennis Roczek 2016-09-26 19:10:20 UTC
still repro
Version: 5.2.1.2 (x64)
Build-ID: 31dd62db80d4e60af04904455ec9c9219178d620
CPU-Threads: 4; BS-Version: Windows 6.19; UI-Render: Standard; 
Gebietsschema: de-DE (de_DE); Calc: group

BTW Phillip: did that worked with any version? Is that a regression? (see title)
Comment 10 Philipp Tobler 2016-09-27 06:02:44 UTC
(In reply to Dennis Roczek from comment #9)

> BTW Phillip: did that worked with any version? Is that a regression? (see
> title)

I honestly don't remember. The "again" was in relation to bug 73836 which has been fixed since a long time. Still repro for me.

Version: 5.2.1.2
Build-ID: 31dd62db80d4e60af04904455ec9c9219178d620
CPU-Threads: 8; BS-Version: Mac OS X 10.11.6; UI-Render: Standard; 
Gebietsschema: de-CH (de_CH.UTF-8); Calc: group
Comment 11 Eike Rathke 2016-09-27 15:35:11 UTC
Workaround: use format code  "192.168.0."0  instead of "192.168.0."@
Comment 12 Eike Rathke 2016-10-05 19:26:06 UTC
Actually  "192.168.0."@  displaying 192.168.0.11 for a numeric value of 11 is wrong. A text format is to be used for display only if the value to be formatted is text. So, "x" should be displayed as 192.168.0.x but 11 should be displayed just as 11. The CSV export is correct, but display is not. Excel and Gnumeric also don't apply a text format to numeric content.
Comment 13 Commit Notification 2016-10-06 19:46:16 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

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

Resolves: tdf#76836 use text format only for text content

It will be available in 5.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 14 Commit Notification 2021-11-18 18:24:31 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7f326714ffbed94a4107b1e896898c1be89ca938

tdf#76836: sc_ucalc: Add unittest

It will be available in 7.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.