Bug 145465 - Conditional formatting rules based on INDIRECT() function not applied if applied by "paste formatting"
Summary: Conditional formatting rules based on INDIRECT() function not applied if appl...
Status: RESOLVED DUPLICATE of bug 145208
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.1.6.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-31 14:01 UTC by FS
Modified: 2021-10-31 15:55 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
ODS file as test case (11.21 KB, application/vnd.oasis.opendocument.spreadsheet)
2021-10-31 14:02 UTC, FS
Details

Note You need to log in before you can comment on or make changes to this bug.
Description FS 2021-10-31 14:01:42 UTC
Description:
Conditional cell formatting isn't applied correctly if the conditional formatting rules were defined by "paste formatting" and if the conditional formatting rule is based on the evaluation of the INDIRECT() function.

Steps to Reproduce:
1. Open the attached ODS file. It has two sheets prepared with same data and conditional formatting defined for C2:F2. Data bars are shown based on fixed min value of 0 and max value of content of B2. The two sheets differ only by the definition of the max value for the data bar. On the first sheet, "=$B2" is used as formula. On the second sheet, "=INDIRECT("B" & ROW())" is used. The Task consists of applying the conditional formatting to C3:F7.

2. Select C2:F2 and paste just the formatting to C3:F7 (by using the "Paste Format" Button or by using "Paste Special" -> "Format"). Check the result - data bars are shown but size depends on max value from B2 instead of B cell from current row.

3. Open the "Manage Conditional Formatting" dialogue while Sheet 2 using Menu "Format" -> "Conditional..." -> "Manage...";

4. Select one of the entries, e.g. "C6:F6" and hit "Edit";

5. Without modifying anything, hit "OK".

6. Notice the current state of the data bars for C6:F6. Now, hit "OK" to close the "Manage Conditional Formatting" dialogue. Notice how the data bars changed.

7. Optionally: repeat steps 3-6 for any cells on first sheet.

Actual Results:
The conditional formatting is applied to the target cells, but the data bar size is determined by cell B2 in every case instead of B3 for row 3, B4 for row 4 and so on.

Steps 3 to 6 explained above will modify the data bars just for the row selected (in my example: C6:F6), but just on the second sheet (where INDIRECT() is used to determine the max value).

Expected Results:
At least on the second sheet (using the INDIRECT() function to determine the max value for the data bar), the data bar size should be determined by the respective value of column B, e.g. by B3 for row 3 and so on automatically.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.1.6.2 (x64) / LibreOffice Community
Build ID: 0e133318fcee89abacd6a7d077e292f1145735c3
CPU threads: 12; OS: Windows 10.0 Build 19043; UI render: Skia/Vulkan; VCL: win
Locale: de-DE (de_DE); UI: en-US
Calc: threaded

Scenario: Calc sheet with data in rows. For every row, a certain decimal "max" value is defined in Column B. Columns C:F contains decimal values < max. Cells C:F should formatted (in this example: using a data bar) with respect to the max value defined in B:. Thus, conditional formatting should be applied while the conditions differ between rows.

I've prepared two sheets to demonstrate that using relative cell references don't work in this scenario (sheet 1). Sheet 2 proves that using INDIRECT() works for this kind of task, but the resulting data bar doesn't show up correctly. It will initially get drawn as if B2 providing the max value. Only after opening the conditional formatting definition and closing it again will update the data bars according to the referenced cell.
Comment 1 FS 2021-10-31 14:02:41 UTC
Created attachment 176041 [details]
ODS file as test case
Comment 2 m_a_riosv 2021-10-31 15:18:36 UTC
The '=' can't be used in the CF's formulae, like if in cells.
Delete the '=' and the formula works just fine.
INDIRECT("B" & ROW())
Comment 3 FS 2021-10-31 15:33:28 UTC
Sorry, but:

1. i can't effectively delete the equation sign. If i remove it and leave the dialogue with OK, it will still be present after opening it again;

2. removing the equation sign from the formula doesn't change anything in the program's behaviour. Still, the conditional formatting isn't applied automatically based on the result of the INDIRECT() result. I still have to open each row's cond. form. definition to make LO calc recongnize the correct max value.
Comment 4 m_a_riosv 2021-10-31 15:55:18 UTC
Sorry, too quick on my side.

It's the same issue as in tdf#145208, saving as xlsx and reopen works fine.

*** This bug has been marked as a duplicate of bug 145208 ***