Bug 145939 - FILESAVE as .XLSX messes up conditional formatting
Summary: FILESAVE as .XLSX messes up conditional formatting
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.2.2.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-28 23:04 UTC by rgiw
Modified: 2021-11-29 12:05 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample document (27.45 KB, application/vnd.oasis.opendocument.calc)
2021-11-29 06:28 UTC, Rainer Bielefeld Retired
Details
Sample file showing the effect ... (11.14 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2021-11-29 09:05 UTC, rgiw
Details
New Test file (19.27 KB, application/vnd.oasis.opendocument.calc)
2021-11-29 10:28 UTC, Rainer Bielefeld Retired
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rgiw 2021-11-28 23:04:13 UTC
Description:
I have configured two conditional formattings based on text content.
When I close the file and reopen it, Calc has the formatting still set up, however with a wrong style.

Steps to Reproduce:
1.mark cell range
2.configure conditional format based on text content and select a style, safe the file and close it
3.reopen the file - conditional formatting has wrong style

Actual Results:
conditional format style is lost

Expected Results:
same conditional formatting style as configured


Reproducible: Always


User Profile Reset: No



Additional Info:
[Information automatically included from LibreOffice]
Locale: de
Module: SpreadsheetDocument
[Information guessed from browser]
OS: Windows (All)
OS is 64bit: no
Comment 1 Rainer Bielefeld Retired 2021-11-29 06:28:02 UTC
Created attachment 176557 [details]
Sample document

NOT reproducible with my own sample document and Installation of Version:7.2.1.2 (x64); Build ID: 87b77fad49947c1441b67c559c339af8f3517e22; CPU threads: 12; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win; Locale: de-DE (de_DE); UI: de-DE; Calc: threaded  |  my default User Profile:

After safe and reopen cell view concerning conditional formatting is like before, and in dialog "Manage Conditional Formatting" the correct conditions and conditional formattings are listded.
Comment 2 Rainer Bielefeld Retired 2021-11-29 06:38:05 UTC
Also NOT reproducible with Server Installation of Version: 7.4.0.0.alpha0+ (x64)  Build ID ae36ee4f3aa544e53e2edad93d6d79160b27bc9d
CPU threads: 12; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win | Special devUserProfile | Locale: de-DE (de_DE); UI: de-DE | Calc: CL


@reporter: 
Please be much more clear. Not "Something went wrong", but 'for cells A1:X20 I applied conditional formatting "Heading" if Cell contents is "toast". Cell B2 with "toast" shows format "Heading" as expected, but after close -> reopen cell B2 looks like "warning", although 'Manage Conditional Formatting" shows "Accent 1" for A1:X20 with "toast".  Or similar.
Comment 3 rgiw 2021-11-29 08:11:58 UTC
Thanks for having a look into it. I'll try to be more specific.
First, I safe my files in XLS format, as I'm using a mixed environment.

I have a table with 6 columns - all text.
In line 2 there is the header and then content up to line 51.
In line 1 I have a formula to calculate the cells which have content in it.
Cells D3:D51 and E3:E51 shall have a conditional format depending on their text content.

I mark call D3:D51, open Format, Conditional, Manage (as I already configured this earlier).
I'm using Cell value is equal to "x" with style "good" and Cell value is not equal to "x" with style "bad".

After closing the file and reopening it, the styles change to ConditionalStyle1 and ConditionalStyle2.

Same for the cells E3:E51, which ends up with style "ConditionalStyle3" after repoening.

Doing this with ODS file type it works.
Comment 4 rgiw 2021-11-29 09:05:08 UTC
Created attachment 176559 [details]
Sample file showing the effect ...

Attached the file - anonymized.
Comment 5 Rainer Bielefeld Retired 2021-11-29 10:28:01 UTC Comment hidden (obsolete)
Comment 6 Rainer Bielefeld Retired 2021-11-29 10:44:50 UTC
Please ignore Version in Comment 5 - bad copy paste!

My test was
More or less REPRODUCIBLE with test document "Bugtracking100.ods" and Server Installation of Version:7.2.1.2 (x64); Build ID: 87b77fad49947c1441b67c559c339af8f3517e22; CPU threads: 12; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win; Locale: de-DE (de_DE); UI: de-DE; Calc: threaded  |  my default User Profile

I did a copy/paste as plain text of contents from first table "Geräteliste" to "Test_ODS", for 'cell="x"' in column D I applied conditional formtting "Good" and in column E I applied "Bad". Cosed and reopened "Bugtracking100.ods", Table "Test_ODS" looked as expected with formatting "Good" and "Bad".

Than saved and reopened as .xlsx:
Expected: again everything in fine in "Test_ODS"
Actual:
a) Conditional Formatting "Good" has moved to column E               😥
b) CF column D has switched to "ConditionalStyle_4"                  😥

NO LONGER reproducible with the same document and  Server Installation of Version7.3.0.0.alpha1+ (x64)  |   Build ID b8d17d754830ab57099dcdfa72a96bfad404ab1a  |  CPU threads: 12; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win  |  Locale: de-DE (de_DE); UI: de-DE  |  Calc: CL  |  Special devUserProfile:
After Save as .xlsx and reopen 
a,b) table "Test_ODS" looks likee before, CF still correct and at it's place 👌

I think this is a FILESAVE bug. File saved from 7.2 looks bad (in (a), (b) after reopen with 7.3
And document saved from 7.3 looks fine after reopen in 7.2

Query "DUPs145939" <https://bugs.documentfoundation.org/buglist.cgi?cmdtype=dorem&remaction=run&namedcmd=DUPs145939&sharer_id=19321> shows possible DUPs?!
Comment 7 Rainer Bielefeld Retired 2021-11-29 10:51:18 UTC
Probably DUP of one of these ones: <https://bugs.documentfoundation.org/buglist.cgi?cmdtype=dorem&remaction=run&namedcmd=DUPs145939Fixed&sharer_id=19321>

For me the CF loss is already reproducible with LibO 6.0 (with some sideeffects a little different to reporter's observations).
Comment 8 rgiw 2021-11-29 11:08:22 UTC
Sounds good to me. Do you need any further input from my side?
Comment 9 Gabor Kelemen (allotropia) 2021-11-29 11:29:54 UTC
Conditional formatting does not retain the associated styles name when saved to XLSX, this is not a bug, but a consequence of conceptual differences. 
See the reasoning given here:

https://bugs.documentfoundation.org/show_bug.cgi?id=124788#c5
Comment 10 rgiw 2021-11-29 12:05:42 UTC
Well, sounds plausible, but then I think we need to differentiate between the style name - which will change as you explained - and the real formatting, which does not show the initial formatting of the original style when using XLSX file format.