Bug 116106 - FORMATTING: LO Calc Date as Number lost in saving
Summary: FORMATTING: LO Calc Date as Number lost in saving
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.1.6.2 release
Hardware: All All
: low minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 145827 (view as bug list)
Depends on:
Blocks: Number-Format
  Show dependency treegraph
 
Reported: 2018-03-01 10:47 UTC by lambda.halbe
Modified: 2023-04-24 15:37 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lambda.halbe 2018-03-01 10:47:40 UTC
Description:
LO Calc: recalculation of formulas at document open or save creates cell format even when format previously removed

Steps to Reproduce:
1. LO Calc: New document, A1=1.1. -> date format will be detected, enter cell formula for B1 =A1+1 -> date format will be detected, B1 Ctrl-M (no format at cell B1, i.e. number), save (.ods)
2. open that document -> cell B1 has date format again

Actual Results:  
cell B1 has date format

Expected Results:
cell B1 should have number format (or no format)


Reproducible: Always


User Profile Reset: No


OpenGL enabled: Yes

Additional Info:


User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/64.0.3282.167 Chrome/64.0.3282.167 Safari/537.36
Comment 1 Eike Rathke 2018-03-01 12:05:25 UTC
If a cell has the General format and a formula expression yields a date or time or boolean result then a corresponding number format of type Date or Time or Boolean is assigned to that cell. Format General effectively means no specific format applied.

Deriving a format on recalculation after load is done because Calc does not know whether the General format is carried over from an older version saved document where these formula result formats where not applied but recalculated on the fly each time the formula was calculated, which led to other problems..

I'm not sure if this situation can be solved at all other than doing hacks depending on the version with which a document was saved, which is quite ill-advised.

Best if you want to force a numeric format in any case then assign a format of type Number other than General, for example 0 for date serial numbers.
Comment 2 lambda.halbe 2018-03-01 12:52:15 UTC
Thank you Eike for your comment. I had expected that to some extend.

Well, IMHO the auto-formatting is done at the wrong time, at least for static format: Here it should be done at cell entry only, not cell loading, and - this could be viewed as another bug or the same - not at undoing: Take my example document (with cell B1 as number) and delete cell B1. Then undo by Ctrl-Z -> cell B1 is date again. This also is not correct from my viewpoint. I assume that to be the same code lines that format quite often. So i would rather think as "not auto format too often" instead of "save general format".

But: Obviously cell formatting should be done every time / repeatedly for conditional formatting still. I know this combination probably yields weird situations and i think i can not give a complete logical way from my limited user perspective either.
Comment 3 QA Administrators 2019-03-02 03:52:09 UTC Comment hidden (obsolete)
Comment 4 QA Administrators 2021-03-02 03:47:31 UTC Comment hidden (obsolete)
Comment 5 QA Administrators 2023-03-03 03:25:23 UTC Comment hidden (obsolete)
Comment 6 Eike Rathke 2023-04-24 15:37:20 UTC
*** Bug 145827 has been marked as a duplicate of this bug. ***