Bug 151817 - FORMATTING Conditional formatting altered when sheet move/copied
Summary: FORMATTING Conditional formatting altered when sheet move/copied
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.4.2.3 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-29 19:49 UTC by Dale Eltoft
Modified: 2022-10-30 00:18 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Before (429.77 KB, image/jpeg)
2022-10-29 19:49 UTC, Dale Eltoft
Details
During (466.18 KB, image/jpeg)
2022-10-29 19:50 UTC, Dale Eltoft
Details
After (416.80 KB, image/jpeg)
2022-10-29 19:50 UTC, Dale Eltoft
Details
Source ods (217.16 KB, application/vnd.oasis.opendocument.spreadsheet)
2022-10-29 20:04 UTC, Dale Eltoft
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dale Eltoft 2022-10-29 19:49:07 UTC
Created attachment 183326 [details]
Before

When I use the Sheet move/copy function to copy a sheet with conditional formatting the logic for the foramtting is altered. There is formatting that is almost identical in different columns. The difference being which columns are used in the formulas. After the copy the conditional formatting for the different columns is consolidated and only uses logic from one of the originals. Rather than try to explain the details I have attached screenshots and the source ods.
Comment 1 Dale Eltoft 2022-10-29 19:50:03 UTC
Created attachment 183327 [details]
During
Comment 2 Dale Eltoft 2022-10-29 19:50:42 UTC
Created attachment 183328 [details]
After
Comment 3 Dale Eltoft 2022-10-29 20:04:54 UTC
Created attachment 183329 [details]
Source ods

The Test.ods file has 2 sheets. The original with 4 conditional formattings and the copy where the 4 were consolidated incorrectly into 2.
Comment 4 m_a_riosv 2022-10-29 20:17:50 UTC
Sorry but what is exactly the difference?
Comment 5 Dale Eltoft 2022-10-29 23:14:29 UTC
Look closely at the Before and After images.
In the Before the first two formulas begin like this
  "AND(P3<>0;O3>119;O3<130;P3<80)"
The third & fourth they begin like this
  "AND(X3<>0;W3>119;W3<130;X3<80)"

Notice that while the logic is identical but the variables (P,O & X,W) are different.

Look at the After image which shows the conditions in the copy of the sheet from the Before. Here there are now only 2 conditions instead of four. The ranges have been combined to apply only the first set of formulas using only the variables that apply to the first pair to both ranges of cells. The second pair (#3 & #4) are missing.

Consequently formatting of cells columns W & X is based on content of cells in columns P & O rather than the W & X content as is the case in the original sheet.
Comment 6 m_a_riosv 2022-10-30 00:18:36 UTC
There is not a bug.
I'll try to explain.
After you have the range to apply: P3:P500;X3:X500
After the formula is: AND(P3<>0;O3>119;O3<130;P3<80)
And it is fine because the formula has relative addresses, so it is calculated in relation with the cell for what it is calculated. It's the same principle that you apply to rows,
When calculate for P3 then AND(P3 it's taken to calculate.
When calculate for X500 then AND(X500 IT'S taken for the calculation.

If fact, if I'm not wrong, the colored cells are the same in both sheets

Please when you have this kind of questions/dudes first put the question in ask.libreoffice.org.