Bug 104097 - FILESAVE: Correct formatted sheet document is miss-formatted displayed after save + reopen
Summary: FILESAVE: Correct formatted sheet document is miss-formatted displayed after ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.3.0.0.alpha1+
Hardware: All All
: medium normal
Assignee: Eike Rathke
URL:
Whiteboard: target:5.4.0 target:5.3.0.1
Keywords: filter:ods, regression
: 103924 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-11-21 23:17 UTC by Stefan_Lange_KA@T-Online.de
Modified: 2017-10-20 09:07 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
zip-file with several ods files to show the problem (1.55 MB, application/zip)
2016-11-21 23:17 UTC, Stefan_Lange_KA@T-Online.de
Details
zip-file with 2 ods documents, belonging to comment #2 (355.34 KB, application/zip)
2016-11-22 20:02 UTC, Stefan_Lange_KA@T-Online.de
Details
Edited sheet document before it is saved and screenshots (1.81 MB, application/x-zip-compressed)
2016-12-04 22:41 UTC, Stefan_Lange_KA@T-Online.de
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan_Lange_KA@T-Online.de 2016-11-21 23:17:14 UTC
Created attachment 128931 [details]
zip-file with several ods files to show the problem

A sheet document with more than one sheet ans with conditional formatting created with LO 5.2.3 is opened with LO 5.3.0. Without changes it is saved or saved as with new name. After the document is closed and reopened, several cells are displayed incorrectly formatted.
IMHO this is caused by conditional formatting with formulas using cells not only from one of the sheets.

In the attached zip-file one can find pairs of ods-files:
- the original file created with LO 5.2.3
- the same file opened with LO 5.3.0 and saved as with new name

Pairs:
- V5, V5a, V5b, V7: conditional formatted cells with formulas using cells not only from one sheet, the documents saved with LO 5.3.0 are "corrupted"

When one opens both file of a pair one can see the differences:

V5: in shheets "Altix IV und V", columns E and M and in line 188, and "Altix n und nb", column D ans cell F76
V5a: in sheet "Altix IV und V", cell M217
V5b: in sheets "Altix IV und V", column D and N, and "Altix n und nb", column L
V7: in sheets "Altix IV und V", column N, and "Altix n und nb", columns and cells 
 
- V6: conditional formatted cells with formulas using cells only from one sheet, the document saved with LO 5.3.0 seems to be correct

I have tested with Windows10 x86 and x64. The results are the same.

Hint:
For contitional formatting are used cells with formulas in hidden columns. I forgot the show them - Sorry! For better see them I have later shown these columns in the document "Testtabelle_Formatierung_1_V5_created_LO_5.2.3.ods".
Comment 1 Telesto 2016-11-22 10:22:17 UTC
I only tested Testtabelle_Formatierung_1_V5 but I can confirm:

Version: 5.3.0.0.alpha1+
Build ID: 02ec51c7e0bf9320b32ec73233ecaaf160448776
CPU Threads: 4; OS Version: Windows 6.2; UI Render: default; Layout Engine: new; 
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2016-11-20_23:12:18
Locale: nl-NL (nl_NL); Calc: CL
Comment 2 Stefan_Lange_KA@T-Online.de 2016-11-22 20:00:54 UTC
After additional tests I have found that error also occurs in sheet documents without conditional formatting but with formulas using cell contents from more than one sheet or from cells in other sheet as this where the formula is placed.

From my original big sheet document, where I have seen the problem first, I have removed with LO 5.2.3 all conditional formattings and - to make the document smaller - much of the contents. When I open this document with LO 5.3.0 and save or save as it without changes, after close and reopen also several cells are displayed not correctly.

In the newly attached zip-file 2 "LO-Test_#2.zip" one can find as in the first zip file a pair of sheet documents - one created with LO 5.2.3 and the other opened and saved as with LO 5.3.0
Version: 5.3.0.0.alpha1+ (x64)
Build-ID: 883024d657fb45c7da459017d2f936aac5644bfb
CPU-Threads: 4; BS-Version: Windows 6.19; UI-Render: Standard; Layout Engine: new; 
TinderBox: Win-x86_64@62-TDF, Branch:MASTER, Time: 2016-11-21_22:11:37
Gebietsschema: de-DE (de_DE); Calc: group

In all sheets of the documents are formulas using cells also from other sheets.
- in the first 3 sheets in columns AB and AC, these formulas are used for conditional formatting in the original document and not used in this reduced document
- in the 4th sheet in cells B3 and B510 
- in the 5th sheet in columns B, G and I
- in the 6th and 7. sheet in upper section in columns C, E, F, H, J, K, M and in many cells of the statistics sections behind the "Summe"-lines (starting in line 253 resp. 172

When one opens both file one can see the differences:
- 1st, 3rd and 4th sheet: OK
- 2nd sheet: I find only one missformatted cell (AE188)
- 5th and 6th sheet: many missformatted cells in both upper sections and statistics sections (wrong font style, missing backgrond color, wrong alignment)
Comment 3 Stefan_Lange_KA@T-Online.de 2016-11-22 20:02:09 UTC
Created attachment 128951 [details]
zip-file with 2 ods documents, belonging to comment #2
Comment 4 Stefan_Lange_KA@T-Online.de 2016-12-04 22:41:30 UTC
Created attachment 129307 [details]
Edited sheet document before it is saved and screenshots

I have tested also with LO 5.3.0 beta1:
Version: 5.3.0.0.beta1+
Build-ID: c7e7a634cf5941fffd97102fe4252aee7445e36b
CPU-Threads: 4; BS-Version: Windows 6.2; UI-Render: Standard; Layout-Engine: neu; 
TinderBox: Win-x86@62-merge-TDF, Branch:libreoffice-5-3, Time: 2016-12-01_06:59:24
Gebietsschema: de-DE (de_DE); Calc: group

I have opened file "Testtabelle_Formatierung_3_V2a_without_cond_format_opened+saved_as_LO_5.3.0.ods" from zip-file "2 LO-Test__2.zip" and have it corrected so that it looks nearly like the original file "Testtabelle_Formatierung_3_V2a_without_cond_format_created_LO_5.2.3.ods". I have made some screenshots of the edited file. When the work was done I have saved the file as "Testtabelle_Formatierung_3_V2a_without_cond_format_opened+saved_as_LO_5.3.0_edited+saved_LO_5.3.0beta1.ods".
After Close and reopen with LO 5.3.0 - and also with LO 5.2.3 - I see many missformatted cells. In only 2 of 7 Sheets I haven't seen errors ("Alle", "Statistik Altix-n und nb"). In all other sheets are some or many missformated cells.
That means that I can't use LO 5.3.0 to edit my sheet documents when the eorror can't be corrected. 
The screenshots and the file "Testtabelle_Formatierung_3_V2a_without_cond_format_opened+saved_as_LO_5.3.0_edited+saved_LO_5.3.0beta1.ods" are contents of attached zip-file "LO_Test_3.zip".
Comment 5 Eike Rathke 2016-12-09 13:31:58 UTC
Investigating.
Comment 6 Commit Notification 2016-12-09 22:53:02 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

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

Resolves: tdf#104097 register reserved cell style names for auto styles

It will be available in 5.4.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 7 Commit Notification 2016-12-09 23:05:56 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

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

rename to RegisterDefinedStyleNames() to clarify, tdf#104097 follow-up

It will be available in 5.4.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 8 Commit Notification 2016-12-10 02:37:15 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1caf633196b43cb81c6f54ed85cf589acbbc89dc&h=libreoffice-5-3

Resolves: tdf#104097 register reserved cell style names for auto styles

It will be available in 5.3.0.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 9 Commit Notification 2016-12-10 02:38:45 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1093721a260d25f986fd794acd914b8fb7bcf92a&h=libreoffice-5-3

rename to RegisterDefinedStyleNames() to clarify, tdf#104097 follow-up

It will be available in 5.3.0.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 10 Stefan_Lange_KA@T-Online.de 2016-12-12 19:37:40 UTC
I have tested the fix with LO 5.4.0 alpha0 and with LO 5.3.0 beta2 (x86 and x64).
I have opened, edited (not all documents), saved and reopened several documents, where the error occured until now.
Result: It's all OK! I didn't find mis-formatted cells.
Comment 11 Justin L 2017-10-20 09:07:49 UTC
*** Bug 103924 has been marked as a duplicate of this bug. ***