Bug 1364406

Summary: wrong cell format in LO 5.1 compared to 4.4
Product: [Fedora] Fedora Reporter: Aleksandar Kostadinov <akostadi>
Component: libreofficeAssignee: Eike Rathke <erack>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: caolanm, dtardon, erack, mstahl, sbergman
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-05 19:36:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
formatbug.ods none

Description Aleksandar Kostadinov 2016-08-05 09:48:42 UTC
Created attachment 1187809 [details]
formatbug.ods

Description of problem:
See attached document and the `SUM Total:` field. In 4.4 (fedora 23) it shows properly as format `[HH]:mm`. But in 5.x (fedora 24) it shows up as `####`.

Version-Release number of selected component (if applicable):
libreoffice-5.1.5.1-2.fc24.x86_64

How reproducible:
always

Steps to Reproduce:
1. open formatbug.ods
2. look at `SUM Total:` field

Actual results:
####

Expected results:
00:00

Comment 1 David Tardon 2016-08-05 10:05:38 UTC
Try to make the cell a bit wider...

Comment 2 Aleksandar Kostadinov 2016-08-05 13:35:31 UTC
Ok, it shows "something" when it is wider but that something is "12:00:00 AM" instead of "00:00" like it used to show in 4.4.

This file has been created with 4.4 (Fedora 23) and showed "00:00". That to me shows that is a bug as old documents should still show correctly in newer versions.

Comment 3 Eike Rathke 2016-08-05 14:12:28 UTC
D54 (and others) have a format [HH]:MM of the Default (system/office) locale applied, D56 has a format HH:MM:SS AM/PM of the English-US locale applied. Check with Ctrl+1 or Format -> Cells.

Comment 4 Eike Rathke 2016-08-05 14:35:36 UTC
In fact the document has things stored wrongly. Opening in 4.4 I see the format on D56 being [H]:MM:SS;@ of Default locale. But the cell is not stored as a time cell like the others, it is of office:value-type="float" office:value="0" instead of office:value-type="time" office:time-value="PT00H00M00S". That seems to confuse the format inheritance for the SUM formula and somehow the default format of the currently active locale is applied (not as Default locale but as fixed locale, only this I'd consider a bug).

You can fix the document by applying the correct format once and save again, after which the cell is correctly saved with office:value-type="time" office:time-value="PT00H00M00S"

Comment 5 Aleksandar Kostadinov 2016-08-05 16:47:31 UTC
I quickly figured how to fix the document when I faced the issue (as you suggested setting format). I can't exactly understand what is confused and how from your comment.

I think though that document renders in one way in 4.4 but in 5.1 is not rendered as before. I think it is good to retain compatibility with older LO versions as long as this doesn't harm user experience in other ways.

I'm reopening for the last time. I leave it up to you to decide whether backward compatibility can be fixed or not.

Comment 6 Eike Rathke 2016-08-05 17:12:26 UTC
As said, 4.4 apparently stored it broken and determined the format inherited from the other time cells it sums in a different way. I'll see if I can do anything. However, that will likely not go into 5.1 anymore.

Comment 7 Aleksandar Kostadinov 2016-08-05 17:26:15 UTC
I think it makes a lot of sense to inherit format from summed cells. It is likely user expects to have the sum cell by default in same format as source cells.
Not sure how should different formats of source cells be handled. But when all source cells are same format it appears to be a no brainer to me. Or probably I have too little experience with spreadsheets.