Bug 128038 - FILESAVE MSExcel 2007-365 conditional format selected style is lost after closing and reopening on libreoffice-6.3.2.2-snap1
Summary: FILESAVE MSExcel 2007-365 conditional format selected style is lost after clo...
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.3.2.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:xlsx
Depends on:
Blocks: XLSX-Conditional-Formatting
  Show dependency treegraph
 
Reported: 2019-10-09 07:41 UTC by stdedos
Modified: 2020-12-18 13:21 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample file (4.78 KB, application/zip)
2019-10-09 20:48 UTC, m_a_riosv
Details

Note You need to log in before you can comment on or make changes to this bug.
Description stdedos 2019-10-09 07:41:54 UTC
Description:
Apply the following Conditional Format to a cell:
FormulaIs: AND(MOD(NOW(),1)>MOD(A1,1),MOD(NOW(),1)-MOD(A1+TIME(0,15,0),1)<0)
Style: Anything that's "noticable and different" than the rest of the cells

Write the quarter of the current time, rounded down (e.g. 10:39 >> 10:30)

Save the file as 'MSExcel 2007-365' format, close and re-open.

Expected result: File opens as-is
  Actual result: Conditional format has "reverted" to the default. It may have also remove the style from "Styles

===================

The feature was never perfect, even on the stock Ubuntu 16.04 libreoffice (that's my earliest).
The replication and behavior are "more consistent" now though

Actual Results:
1.
2.
3.

Expected Results:
1.
2.
3.


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 m_a_riosv 2019-10-09 20:48:53 UTC
Created attachment 154871 [details]
Sample file

Sample file works for me
Comment 2 m_a_riosv 2019-10-09 20:49:49 UTC
Version: 6.3.3.0.0+ (x64)
Build ID: cb14e82a823f313e3e1bedc83c60a5d575b1c89e
CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; 
TinderBox: Win-x86_64@42, Branch:libreoffice-6-3, Time: 2019-10-01_07:29:14
Locale: es-ES (es_ES); UI-Language: en-US
Calc:
Comment 3 stdedos 2019-10-21 12:06:05 UTC
I don't completely understand how this bug works, so, I am sorry if my description is lacking

On your sample file:

* Remove the '_1' from the name of the style
* You may validate that the Conditional Style reference name is updated
* Save, Close, Re-open
* There will be now 2 styles (one with '_1', one without)
* You may validate that the Conditional Style reference name is updated to the '_1'
Comment 4 NISZ LibreOffice Team 2020-12-18 10:20:32 UTC
(In reply to stdedos from comment #3)
> I don't completely understand how this bug works, so, I am sorry if my
> description is lacking
> 
> On your sample file:
> 
> * Remove the '_1' from the name of the style
> * You may validate that the Conditional Style reference name is updated
> * Save, Close, Re-open
> * There will be now 2 styles (one with '_1', one without)
> * You may validate that the Conditional Style reference name is updated to
> the '_1'

This happens because of the different concepts of storing conditional formatting in ODS and XLSX files.

Calc uses styles to define conditional formatting settings and stores the used condition+style in ODS files.
Excel on the other hand sets a bunch of direct cell formatting settings and stores those along the condition.

This is why on opening an XLSX file Calc autogenerates a ConditionalStyle_N style, to bridge these differences.
If you change the name of this, that's saved as a new cell style but on the next opening Calc autogenerates another set of ConditionalStyle_N styles because of the conditional formatting.

Inconvenient as it is, this is not a bug but a difference in file formats and different applications internal workings. What you see should be the same regardless.