Bug 150570 - [FORMATTING] Editing conditional formatting by adding a reference to another sheet can cause the wrong condition to change
Summary: [FORMATTING] Editing conditional formatting by adding a reference to another ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.3.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Conditional-Formatting-Editing
  Show dependency treegraph
 
Reported: 2022-08-23 20:59 UTC by Ville Aakko
Modified: 2023-08-19 11:51 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
A LO calc file which can be used to reproduce the bug. (8.19 KB, application/vnd.oasis.opendocument.spreadsheet)
2023-01-31 15:03 UTC, Ville Aakko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ville Aakko 2022-08-23 20:59:08 UTC
Description:
Editing a conditional formatting with a formula referencing to another cell can be edited via the interface. One can use the Format -> Conditional -> Manage to edit a condition rule.

The UI can allow the user to edit in references to another sheet, however the conditions will be applied to the sheet which is active after clicking OK. Usually, this will be the cell the user wants to reference to.

One can even "add" a conditional formatting to a sheet which doesn't have any this way. The condition does not seem to work, until the file is saved and then re-opened. After doing that, a sheet which originally did not have a condition will now have one.

There is a workaround: when editing the cell reference, always change the sheet back to the one where the condition being edited is in. However, this is very unintuitive, and the bug can result in possibly very complex conditions being lost (albeit it seems CTRL+Z works), and confused users.

As a sidenote, adding a condition works correctly, despite the UI and process being very similar (i.e. it does not add a condition to the sheet being referenced to, despite it being the selected sheet when closing the dialog).

Steps to Reproduce:
1. Make a file with at least two sheets, with a conditional formatting in sheets A and B (or just A)
2. Use Format -> Conditional -> Manage to edit a condition on sheet A with a formula
3. Use the UI to select a cell to be referenced in sheet B on the condition on sheet A, more precisely:
3.1) click on the formula field
3.2) click on sheet B
3.3) click on cell(s) to be referenced by the formula
4. click OK twice (do not change back to sheet A before this step, as no user would do that either - but that would work around the bug indeed!)

Actual Results:
After clicking OK twice (to close the dialogs), the conditional formatting rule in sheet A is unchanged. However, either one of the following happens: 
1) a conditional formatting rule in sheet B gets overwritten
2) if sheet B does not have any conditional formatting rules, one will be added.

Expected Results:
The conditional rule in sheet A should have been changed as the user requested.

The conditional rules in sheet B should never change, if a user chose a condition in sheet A to be edited.


Reproducible: Always


User Profile Reset: No


OpenGL enabled: Yes

Additional Info:
Version: 7.4.0.3 / LibreOffice Community
Build ID: 40(Build:3)
CPU threads: 32; OS: Linux 5.19; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
7.4.0-2
Calc: threaded
Comment 1 Buovjaga 2023-01-31 12:58:18 UTC
(In reply to Ville Aakko from comment #0)
> Steps to Reproduce:
> 1. Make a file with at least two sheets, with a conditional formatting in
> sheets A and B (or just A)

Please attach an example document.
Set to NEEDINFO.
Change back to UNCONFIRMED after you have provided the document.
Comment 2 Ville Aakko 2023-01-31 15:03:01 UTC
Created attachment 185032 [details]
A LO calc file which can be used to reproduce the bug.

I've attached an example document (for what it is worth);

however I have to point out that an example document is almost pointless in this case, as this is a bug in the interface. There is no way to make an example document which would be an example of the bug just by existing as a document. The user (or developer) still needs to reproduce the steps I've outlined in the report.

In the context of the example file, I'm just repeating stuff in the report below:

Sheet "A" has a conditional formatting (containing a formula). Use the steps in the description to manage the condition in sheet "A". Try to change the referenced cell to one in the "B" sheet, say, B.C3. 

Note: use the mouse (UI), don't type. The relevant trigger for the bug is to change to a different sheet when managing the condition in a sheet, and clicking OK when the other sheet is selected as the active (shown sheet). 

As a result, the condition originally selected to be managed is not changed, but another one created (or an existing one edited) erroneously.
Comment 3 Buovjaga 2023-08-18 10:18:25 UTC
Tested with the file and could not reproduce. Condition can be changed fine without side effects.

Arch Linux 64-bit, X11
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: a389e6bd7aacfa4e1ff1ea3a46199fb381d1131f
CPU threads: 8; OS: Linux 6.4; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 10 July 2023
Comment 4 Ville Aakko 2023-08-19 11:10:20 UTC
Hi,

I have re-tested this again on Arch Linux. I can still reproduce this using the libreoffice-fresh package. It is of course possible it has been fixed on the alpha build.

Buvjaga, Just to make sure, as your wording is a bit unclear: this bug is not about inability to change conditional formatting - most can be changed without any issues. The issues arise only if the user references cells in a different sheet to where the condition is being applied to.

Version: 7.5.5.2 (X86_64) / LibreOffice Community
Build ID: 50(Build:2)
CPU threads: 32; OS: Linux 6.4; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: fi-FI
7.5.5-1
Calc: threaded
Comment 5 Buovjaga 2023-08-19 11:14:24 UTC
(In reply to Ville Aakko from comment #4)
> Hi,
> 
> I have re-tested this again on Arch Linux. I can still reproduce this using
> the libreoffice-fresh package. It is of course possible it has been fixed on
> the alpha build.
> 
> Buvjaga, Just to make sure, as your wording is a bit unclear: this bug is
> not about inability to change conditional formatting - most can be changed
> without any issues. The issues arise only if the user references cells in a
> different sheet to where the condition is being applied to.

Sure, I went by the steps in the description and nothing unusual happened.
Comment 6 Buovjaga 2023-08-19 11:17:43 UTC
Whoops, I must have been careless with observing the result. I do reproduce now that a new condition is created in sheet B while the one in A is left intact.
Comment 7 Buovjaga 2023-08-19 11:51:44 UTC
Bibisected with linux-64-5.3 repo to 5b8c22379e2eae74f7ed78326ab89483db5c6624
tdf#96453, tdf#100793 rework transfer of data between cond format dlgs