Bug 61313 - CONDITIONAL FORMATTING: Icon set should have a color reverse switch
Summary: CONDITIONAL FORMATTING: Icon set should have a color reverse switch
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected) release
Hardware: Other All
: medium enhancement
Assignee: Not Assigned
Keywords: difficultyInteresting, easyHack, skillCpp, skillUI
Depends on:
Blocks: Conditional-Formatting
  Show dependency treegraph
Reported: 2013-02-22 21:42 UTC by Horst
Modified: 2018-02-25 07:57 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:

Smiley dialog example.png (102.42 KB, image/png)
2018-02-25 07:53 UTC, Gerry

Note You need to log in before you can comment on or make changes to this bug.
Description Horst 2013-02-22 21:42:56 UTC
The new Icon Set should have a switch for color reversal (like Excel). Small values are not always bad (red) and big values are not always good (green).

An alternative would be also an "Icon Set 2 invers colors".
Comment 1 Markus Mohrhard 2013-03-25 08:45:06 UTC
Additionally there should be a way to change each icon but I have no plans to implement that in the near future.
Comment 2 Gerry 2013-11-26 10:11:49 UTC
I second this enhancement request. However, maybe it can be solved easier:

Instead of switching the order of icon sets, why not just switching the signs. It should be possible to select:

"<=" instead of ">=" 

Then, the problem is solved. I assume this is easier to implement?!?
Comment 3 Markus Mohrhard 2017-04-08 18:56:24 UTC
This has been implemented for a long time. The options are just not exposed in the UI.
Comment 4 Markus Mohrhard 2017-04-08 22:48:46 UTC
The remaining part that needs implementation for this feature is to introduce advanced configuration solutions for the icon set entry in the conditional format dialog.

The code for the icon set entry in the dialog is in sc/source/ui/condformatdlg

The code for the icon set model part, including the reverse flag, the configuration that allows any image for an icon can be found in sc/inc/colorscale.hxx and sc/source/core/data/colorscale.cxx
Comment 5 abstatic 2018-02-24 23:28:48 UTC

I'd like to work on this, however I don't completely understand this. Can anyone please provide code pointers, and a more clear description of the problem ?
Comment 6 Gerry 2018-02-25 07:49:07 UTC
@abstatic: That's great to hear that you want to work on this bug. When I use icon sets in conditional formatting, I frequently need to use workarounds, because Calc is lacking the feature to reverse the color or icons.

I illustrate the issue with an example using the icon set "3 smileys":
The issue is that both, the order of the smileys :-) :-| :-( AND the order of the sign >= are hard coded. In other words, at the moment, Calc always assigns a :-( to high values. This does not always make sense. 

For example, if you imagine an exam with 100 points. You fail if you have < 50 points, you pass if you have >= 50 points and you get an excellent grade if you have => 75 points. 

What Calc can do (this is wrong!):

Grades (100 points in exam is very good, 0 points is very bad)
100 :-(
95 :-(
30 :-)
22 :-)
55 :-|

What Calc should be able to do (this is correct!):

Grades (100 points in exam is very good, 0 points is very bad)
100 :-)
95 :-)
30 :-(
22 :-(
55 :-|

What we need is that the order can be inversed. IMHO, it should be possible for the user to switch the sign >= to <= if the scale is inverse. Currently, in the dialog, the sign >= is hard coded and cannot be changed by the user. 

Please see the attached screnshot "Smiley dialog example" to illustrate that I cannot change the order. Instead of an >= I need an <= for my scale of exam points.
Comment 7 Gerry 2018-02-25 07:53:33 UTC
Created attachment 140125 [details]
Smiley dialog example.png

For some scales, it is important that the user can inverse the order of the smileys/icons/colours, because high values are not always bad or good. In this example with points in an exam, I cannot correctly assign smileys, because higher values mean a better grade. What we need is an inverse order switch.
Comment 8 Gerry 2018-02-25 07:57:22 UTC
Additional info: Markus Mohrhard had implemented the conditional formatting feature, so he probably is the person who can help you with the code pointers.

He already gave a few hints in comment 4