Bug 151638 - Colour scale conditional format not persistent after move
Summary: Colour scale conditional format not persistent after move
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.4.2.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Conditional-Formatting
  Show dependency treegraph
 
Reported: 2022-10-19 10:01 UTC by maison
Modified: 2023-07-12 04:13 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Fix the colour scale conditional format not persistent after move (8.30 KB, application/vnd.oasis.opendocument.spreadsheet)
2023-02-27 20:59 UTC, maison
Details

Note You need to log in before you can comment on or make changes to this bug.
Description maison 2022-10-19 10:01:31 UTC
Steps to Reproduce:

Define a colour scale conditional format on continuous cells. For example, put numbers from 1 to 20 in the first column, then format the column.
Then reorganise your data by moving some cells, rows or columns of them within the conditional area: press Alt and drag them with the mouse.

 Extra steps if you want to test more:
 Cancel the move.
 Also define a formula based conditional format on other cells and do the same actions.

Actual Results:
The colours are not preserved in the whole range, as the original data is still there.
Check the conditional format management: your range is now broken in two pieces.

 Extra steps if you want to test more:
 If you cancelled the move, your cells are back at the original place and with the original colour (the latter is only temporary until you close the file). But check the conditional format management: your range is still broken in two, sometimes even in a third piece.
 If you defined a formula based conditional format, all these actions will have no effect on the conditional range.

Expected Results:
Like with formula based conditional format, keep the colour scale range compact and don’t break it into smaller and smaller pieces, every time you reorganise the data.

Reproducible: Always

User Profile Reset: No

Additional Info: A test file seems useless to add; it can be created if you follow the steps.
Comment 1 Rafael Lima 2022-10-19 14:21:57 UTC
(In reply to bugzilla from comment #0)
> Additional Info: A test file seems useless to add; it can be created if you
> follow the steps.

Attaching a test file is always helpful, since it ensures we're seeing the same thing as you are.

Plus it also saves a lot of time with testing, which is important given the number of bugs to triage.

---------------

So I added the numbers 1 - 20 in the range G1:G20 and applied the Color Scale. Then I selected cell G17 (Ctrl-X to cut) and pasted it in K1.

Now when I open the Manage conditional formats dialog, I get two segments of Color Scale:
- G18:G20;G1:G16 (the original range without G17)
- K1 (only the pasted cell as a new and separate conditional range)

So what do you think the expected outcome should be? Should we have a single range with G18:G20;G1:G16;K1 ? This way K1 would receive the same color as it previously had.
Comment 2 m_a_riosv 2022-10-19 17:33:42 UTC
Drag it's like cut, and CF being part of the cell format it's also cut like the other cell formats. What for sure has their pros and cons about CF. But changes it maybe has deeply implications, like the ODF specifications. 

Time ago I did a bug report about ranges reunification for CF, only partially has been improved.

https://bugs.documentfoundation.org/show_bug.cgi?id=87274
Comment 3 maison 2022-10-19 21:55:38 UTC
@Rafael Lima, sorry but your action is different than the steps I mentioned. You moved your data out of the range.

With this bug I assume that the conditional format move is generally functional. The problem is that it doesn’t behave the same way if the conditional format is *colour scale* rather than formula.

So, @m.a.riosv, your subject is on other considerations; but this bug is only about the colour scale not being treated like the the rest of the conditional formatting.
Comment 4 Buovjaga 2023-02-27 13:23:13 UTC
Please attach an example document.
Set to NEEDINFO.
Change back to UNCONFIRMED after you have provided the document.
Comment 5 maison 2023-02-27 20:59:09 UTC
Created attachment 185620 [details]
Fix the colour scale conditional format not persistent after move

It takes no time to create the file, but if you understand the bug described, the dynamics can’t be summarised in a static file; you have invert the cells to see the result.
Comment 6 maison 2023-03-19 09:03:51 UTC
Buovjaga, what’s the news?
Comment 7 Buovjaga 2023-03-22 15:50:33 UTC
(In reply to maison from comment #5)
> Created attachment 185620 [details]
> Fix the colour scale conditional format not persistent after move
> 
> It takes no time to create the file, but if you understand the bug
> described, the dynamics can’t be summarised in a static file; you have
> invert the cells to see the result.

Reproduced with Alt-click moving.

Arch Linux 64-bit, X11
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 74f398bb58510087cc4a11bb2253715771a2c6b2
CPU threads: 8; OS: Linux 6.2; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 22 March 2023
Comment 8 Tibor Nagy 2023-04-26 11:19:35 UTC

*** This bug has been marked as a duplicate of bug 154906 ***
Comment 9 maison 2023-07-11 11:29:33 UTC
(In reply to Tibor Nagy (NISZ) from comment #8)
> 
> *** This bug has been marked as a duplicate of bug 154906 ***

I don’t understand why that bug was a duplicate, but in spite of that correction, but this bug is not resolved in 7.5.4.2.
Comment 10 ady 2023-07-11 13:34:43 UTC
(In reply to maison from comment #9)
> this bug is not resolved in 7.5.4.2.

I think that a more precise description (of _exactly_ how to test) is needed.

*For example*, in attachment 185620 [details]:

1. Select cell A3 (not just have the focus on it)
2. Press and hold [ALT] and drag the cell from A3 to D3

Actual result:
* The Conditional Format seems OK, where the affected range was modified according to the moved cell.
* Both, the content and the background color, are moved, together with the CF's range, but the cell ends in C3 instead of the desired cell D3.

So, if the above example were to be accurate, that would mean that the original bug was solved, but there is another bug to be resolved (i.e. a new bug report is needed).

@maison, would you please specify the _exact_ steps in order to test this report?
Comment 11 maison 2023-07-11 20:27:03 UTC
OK. The problem is that the patch didn’t take the problem as a whole, but only about the colour scale. That’s to say that the other options under it still have the original problem.

Needless to say, to test this, the original example still can be reproduced if you use “data bar” (or the next ones) instead of “colour scale” conditional format.

(Regarding the colour scale, I agree with ady that the patch works for the simple earlier example in the bug report. I have a big file where I use several colour scales on thousands of lines, so I will add something more accurate in this report if I can catch some steps to reproduce. In the mean time, it would be nice to resolve the problem for the other options.)
Comment 12 QA Administrators 2023-07-12 03:14:38 UTC Comment hidden (obsolete)