Bug 104026 - Conditional formatting is not updated when deleting a row
Summary: Conditional formatting is not updated when deleting a row
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.2.3.3 release
Hardware: All All
: medium normal
Assignee: Markus Mohrhard
URL:
Whiteboard: target:5.4.0 target:5.3.2
Keywords:
: 103367 103368 104245 104682 (view as bug list)
Depends on:
Blocks: Conditional-Formatting
  Show dependency treegraph
 
Reported: 2016-11-19 08:41 UTC by p_kongstad
Modified: 2017-10-28 18:25 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Conditional formatting error. (9.74 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-11-19 08:41 UTC, p_kongstad
Details

Note You need to log in before you can comment on or make changes to this bug.
Description p_kongstad 2016-11-19 08:41:21 UTC
Created attachment 128858 [details]
Conditional formatting error.

In a spreadsheet where conditional formatting is used to compare column A with column B and to show a background color in case of 'not equal to'.

What happens:
When deleting a row with conditional formatting, the row moved up in place of the deleted row is not updated correctly. The conditional formatting shows for this row that 'not equal to' and the background color is shown. Then you need to format from either the upper or lower part the spreadsheet to have the correct result.

Expected:
That the conditional formatting is working as on the remaining rows. And no needs to copy the formatting.

1.  Create a new spreadsheet with the same value in column A + B. I have used numbers.

2. Then from menu Format/Conditional/Condition Formatting in cell A1 you ask for comparison 'Cell Value is' 'Not equal to' B1. 'Apply Style' you chose new style. Here you open tab 'Background' and select a color.

3. Clone the formatting using the icon with the brush in A1 and apply this to your rows in column A. Now all cells in column A should  have no background color.

4. If you try to change a value in column B the corresponding cell in column should change background color. Change the value back so it equals the row value in A.

5. Delete a row. Now your row replacing the deleted row will have a background color. It should not. It will disappear if you clone formatting from the remaining rows.

Attached is a simple spreadsheet to show the bug
Comment 1 p_kongstad 2016-11-19 08:53:52 UTC
The same issue happens if you add a row. As long as value in column A and B on the inserted row is empty it shows no color, but if you type 1 in the cell a on the row and the same value in B you will have a background color in A. This is an error.

When checking the Format/Conditional Formatting/Manage you see in the inserted colums 'Conditional Formats'/Range the value A4:A5 (inserted row 5) while in 'First Condition' 'Cell value is!=$sheet1.$B4. This is wrong.

When deleting a row, the value in 'Cell value is!=$Sheet1.$#REF!. This is also wrong.
Comment 2 A (Andy) 2016-11-19 09:15:35 UTC
Reproducible with LO 5.2.3.3 (Win 8.1).

Small note: Before using the brush in step 3 I had to make sure that the condition in step 2 is $sheet1.$B1 instead $sheet1.$B$1.
Comment 3 p_kongstad 2017-01-06 12:21:24 UTC
Bug still present in Version: 5.2.4.2
Comment 4 p_kongstad 2017-01-28 08:39:09 UTC
*** Bug 104245 has been marked as a duplicate of this bug. ***
Comment 5 p_kongstad 2017-02-03 18:07:17 UTC
Bug still present in  5.3.0.3
Comment 6 Commit Notification 2017-03-16 21:03:40 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=3f0f35c89f3f64fcb110483fd562a59f729dc344

the range should be updated after the references, tdf#104026

It will be available in 5.4.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2017-03-16 21:04:13 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ad9336f29650dc38be06d771f5c3dbc7f0078ff1

add tests for tdf#104026

It will be available in 5.4.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 8 Markus Mohrhard 2017-03-16 21:47:56 UTC
*** Bug 103368 has been marked as a duplicate of this bug. ***
Comment 9 Commit Notification 2017-03-17 10:18:21 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=0ee960fb555deb0a91e8c0e81812ab888ff13c2f&h=libreoffice-5-3

the range should be updated after the references, tdf#104026

It will be available in 5.3.2.

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

Affected users are encouraged to test the fix and report feedback.
Comment 10 p_kongstad 2017-04-05 16:58:40 UTC
I have just been updated to 5.3.2.2 on linux.

The patch has resolved the issue.
Comment 11 Aron Budea 2017-04-05 20:43:46 UTC
Thanks for the verification.
Comment 12 Xisco Faulí 2017-10-27 11:09:19 UTC
*** Bug 104682 has been marked as a duplicate of this bug. ***
Comment 13 Xisco Faulí 2017-10-28 18:25:04 UTC
*** Bug 103367 has been marked as a duplicate of this bug. ***