Bug 107425

Summary: Conditional formatting is applied as direct format rather than a style
Product: LibreOffice Reporter: Heiko Tietze <heiko.tietze>
Component: CalcAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED NOTABUG    
Severity: normal CC: miguelangelrv
Priority: medium    
Version: 5.4.0.0.alpha0+   
Hardware: All   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=122697
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 87351    
Attachments: Picture or it didnt happen
Example

Description Heiko Tietze 2017-04-25 15:13:42 UTC
Created attachment 132834 [details]
Picture or it didnt happen

Applying a style is expected to not work as direct formatting. So either the text is changed or the function improved.

1. Enter some data per =rand()
2. Style the cells with 'Good'
3. Apply a conditional formatting with Cell value is + less than + 0.5 + Apply style = Bad

Bad cells still have the style Good.

Version: 5.4.0.0.alpha0+
Build ID: e175f9f4393eb3badd763fa5b1cdc5b3aabab0e4
CPU threads: 4; OS: Windows 6.1; UI render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2017-04-19_01:06:49
Locale: de-DE (de_DE); Calc: group
Comment 1 m_a_riosv 2017-04-28 23:11:08 UTC
Hi @Heiko, could be easy attaching a sample file.
Comment 2 Heiko Tietze 2017-04-29 08:05:31 UTC
Created attachment 132948 [details]
Example

Conditional formatting with Cell Style = Bad for values below 0.5. Column B has some cells with formatting Good, in column C all cells are styled as Warning. Press ctrl+R to see the conditional formatting overriding the user style.
Comment 3 m_a_riosv 2017-04-29 14:22:30 UTC
I don't know if I understand right the question, but if it is that the style showed on the side bar it's still the one that cells have without the CF, not the applied by CF, I can confirm the issue.

It never works on any version of LIbreOffice (I have tested with several since the first)

I'm not able to find now, but I think it was reported before.
Comment 4 Heiko Tietze 2017-05-01 09:23:23 UTC
(In reply to m.a.riosv from comment #3)
> I don't know if I understand right the question, but if it is that the style
> showed on the side bar it's still the one that cells have without the CF,
> not the applied by CF, I can confirm the issue.

CF pretends to 'apply a style' but does format directly. Ordinary users do not exactly understand what styles are so we make this crystal clear wherever we can.

Solution A: Apply a style per cell
Solution B: Change the text to "Apply formatting", or the like (suboptimal since it offers styles)
Comment 5 Markus Mohrhard 2017-06-25 21:09:36 UTC
(In reply to Heiko Tietze from comment #4)
> (In reply to m.a.riosv from comment #3)
> > I don't know if I understand right the question, but if it is that the style
> > showed on the side bar it's still the one that cells have without the CF,
> > not the applied by CF, I can confirm the issue.
> 
> CF pretends to 'apply a style' but does format directly. Ordinary users do
> not exactly understand what styles are so we make this crystal clear
> wherever we can.
> 
> Solution A: Apply a style per cell
> Solution B: Change the text to "Apply formatting", or the like (suboptimal
> since it offers styles)

This is a misconception on your side. Conditional format should exactly not change the existing style of the cell. A conditional format only applies its own style if the condition is met. The existing cell style is still retained and will be applied again when the condition is not met any more.