Bug 156320

Summary: Conditional formats not copied properly
Product: LibreOffice Reporter: Lazarus
Component: CalcAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: normal CC: buzea.bogdan, miguelangelrv
Priority: medium    
Version: 7.5.4.2 release   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 87351    
Attachments: Original individual column formats
Incorrectly duplicated conditional formats
Sample file

Description Lazarus 2023-07-17 04:28:43 UTC
I have conditional formats with ranges like this:

A:A
B:B
C:C
D:D
E:E
F:F

But when I duplicate the sheet, the new sheet has ranges like this:

A:A
B:B,C:E
F:F
Comment 1 m_a_riosv 2023-07-18 02:26:41 UTC Comment hidden (obsolete)
Comment 2 danomois 2023-07-18 02:44:24 UTC
Lazarus,

Hello I am not sure if this is a bug or not.

I believe I have replicated the behavior; however, it looks to be more just a convention.

In that, if A:A has conditional format 'red fill if number<1' for example

and B:B, C:C, D:D, and E:E all have the same conditional format 'green fill if number<1' - then when you duplicate the sheet you'd see the ranges you described.

Because the conditional format 'green fill if number<1' is the same for Columns B,C,D, and E - and the program just groups those together.

That said, if you could be more specific if this is happening when each column has a different conditional format? Or if you can say why specifically you view it as a bug - please comment back!

Thank you
Comment 3 m_a_riosv 2023-07-18 07:58:21 UTC
It's not a bug, it was done a time ago to avoid the duplication of the conditional format, very annoying in other cases.
Comment 4 Lazarus 2023-07-18 21:24:46 UTC
Created attachment 188449 [details]
Original individual column formats
Comment 5 Lazarus 2023-07-18 21:26:32 UTC
Created attachment 188450 [details]
Incorrectly duplicated conditional formats
Comment 6 m_a_riosv 2023-07-18 21:27:56 UTC Comment hidden (obsolete)
Comment 7 Lazarus 2023-07-18 21:32:15 UTC Comment hidden (obsolete)
Comment 8 m_a_riosv 2023-07-18 21:36:08 UTC Comment hidden (obsolete)
Comment 9 Lazarus 2023-07-20 07:42:32 UTC
Created attachment 188489 [details]
Sample file

Thanks for looking
Comment 10 ady 2023-07-20 12:57:10 UTC
Conditional Format Color Scale is one example of the potential problems of unifying/combining ranges in CF management (typically seen when copying ranges or worksheets).

When the min and max values for the CF Color Scale are, for example, within the same column (as in attachment 188489 [details] from comment 9), then unifying/combining ranges (with different columns) will change the resulting Color Scale, because the scale of values in the unified/combined range will consider min and max values of the combined range as a whole, not within each column separately as the original CF does.

In these cases, combining the CF ranges is not the best procedure (and probably inadequate in too many situations).

Repro in many old versions and in a recent LO Dev 24.2.