Bug 154906 - When copying a conditional format, the display results in an error in Calc
Summary: When copying a conditional format, the display results in an error in Calc
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Tibor Nagy
URL:
Whiteboard: target:7.6.0 target:7.5.4
Keywords:
: 140305 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-04-19 12:04 UTC by NISZ LibreOffice Team
Modified: 2023-04-28 08:53 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample file (8.42 KB, application/vnd.oasis.opendocument.spreadsheet)
2023-04-19 12:05 UTC, NISZ LibreOffice Team
Details
Screensot of the problem (146.40 KB, image/png)
2023-04-19 12:06 UTC, NISZ LibreOffice Team
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NISZ LibreOffice Team 2023-04-19 12:04:54 UTC
Description:
If you copy a conditional format within Calc, it will copy the conditional format but not display it.

Steps to Reproduce:
1. Create a new document in calc.
2. Give a value for 3 cells
3. Select previous 3 cells
4. Format -> Conditional -> color scale
5. Select previous 3 cells
6. Copy and paste other cells

Actual Results:
After copying, it copies the conditional format but does not display.

Expected Results:
After copying Conditional format is copied correctly.


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 61b41646c5a93ca24f2c9f143cdb0da2c9258989
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Vulkan; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: CL threaded
Comment 1 NISZ LibreOffice Team 2023-04-19 12:05:39 UTC
Created attachment 186784 [details]
Sample file
Comment 2 NISZ LibreOffice Team 2023-04-19 12:06:17 UTC
Created attachment 186785 [details]
Screensot of the problem
Comment 3 ady 2023-04-19 17:24:09 UTC
FWIW, In  attachment 186784 [details], in the Manage Conditional Format dialog, the conditional format for each of the 3 cells is not "grouped", as it is the first conditional (grouped for the 3 original cells), so the max and min are the same of the cell itself, and thus there is no "scale" of colors.
Comment 4 Commit Notification 2023-04-26 09:40:34 UTC
Tibor Nagy committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3fa15dd614bd72ddb36dbe033abeef5609d31f38

tdf#154906 tdf#129813 tdf#129814 sc: fix conditional format color scale

It will be available in 7.6.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Tibor Nagy 2023-04-26 11:19:35 UTC
*** Bug 151638 has been marked as a duplicate of this bug. ***
Comment 6 Tibor Nagy 2023-04-26 11:20:43 UTC
*** Bug 140305 has been marked as a duplicate of this bug. ***
Comment 7 ady 2023-04-27 10:57:03 UTC
(In reply to Commit Notification from comment #4)
> It will be available in 7.6.0.

FWIW, now in 7.6.alpha:

Selecting the entire range of cells that have the conditional format color scale and copy+pasting it to another range will result in the CF also copied and performing as expected (with caveats, keep reading).

Previously copy+pasted ranges maintain their prior CF. "Old" cell ranges would need to be copy+pasted again, or the CF manually corrected. New copy+pasted ranges will work as expected with this color scale CF. I think this is correct; just wanted to be clear regarding how exactly I tested the new behavior.

There is one caveat. The newly-pasted range will be part of the same CF color scale as the original range. If the new range is expected to be independent from the original range (i.e. independent color scales), then the CF needs to be replicated separately (i.e. 2 independent rows in the CF manage dialog).
Comment 8 maison 2023-04-27 11:09:24 UTC
Thanks for the update and especially for the code correction.
Does it also work in the following cases: when you move (reorganise) the cells, when you undo the copy and move, when you extend the range by dragging on extra cells, all as mentioned in Bug 151638 ?
Comment 9 Commit Notification 2023-04-28 08:53:53 UTC
Tibor Nagy committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/f2034af7eee1174481c4220decea51d00e8b8ab0

tdf#154906 tdf#129813 tdf#129814 sc: fix conditional format color scale

It will be available in 7.5.4.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.