Bug 107289 - Conditional formatting breaks on adding then deleting a new sheet
Summary: Conditional formatting breaks on adding then deleting a new sheet
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.2.0.4 release
Hardware: All All
: medium normal
Assignee: Markus Mohrhard
URL:
Whiteboard: target:6.0.0
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Conditional-Formatting
  Show dependency treegraph
 
Reported: 2017-04-20 11:32 UTC by Erike Magegere
Modified: 2017-07-27 17:53 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
initial spread sheetwith cursor placed where double click (142.72 KB, image/png)
2017-04-21 13:54 UTC, Erike Magegere
Details
after double click (30.42 KB, image/png)
2017-04-21 13:56 UTC, Erike Magegere
Details
sheet added (99.94 KB, image/png)
2017-04-21 13:57 UTC, Erike Magegere
Details
result after delete (143.81 KB, image/png)
2017-04-21 14:03 UTC, Erike Magegere
Details
sample sheet used to produce screen shots (19.04 KB, application/vnd.oasis.opendocument.spreadsheet)
2017-04-21 14:05 UTC, Erike Magegere
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Erike Magegere 2017-04-20 11:32:23 UTC
Description:
I have an accounting spreadsheet where some fields are changed to a red background when certain cells are not equal.  doing things to other sheets tends to break these even though the formula, data, and the style are the same.  It is repeatable when I accidently create another sheet (ok) and delete it (fails). 

Steps to Reproduce:
1.create sheet
2.delete sheet
3.

Actual Results:  
create a new sheet
delete the sheet
go to original sheet and conditions do not work (in this case all showing errors ie background standard rather that what is defined in style from conditional format equation.

Expected Results:
conditions do not work (in this case all showing errors ie background standard rather that what is defined in style from conditional format equation.
I have found no way to fix except go back to last save and re-apply changes and I hope not to bump whatever is putting up the create new sheet dialog (i have arthritis)


Reproducible: Always

User Profile Reset: No

Additional Info:
[Information automatically included from LibreOffice]
Locale: en-US
Module: SpreadsheetDocument
[Information guessed from browser]
OS: Linux (All)
OS is 64bit: yes


Builds ID: LibreOffice 5.3.2.2


User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36
Comment 1 m_a_riosv 2017-04-20 21:17:29 UTC
Please attach a minimal sample file where to reproduce the issue.
Comment 2 Erike Magegere 2017-04-21 13:54:50 UTC
Created attachment 132734 [details]
initial spread sheetwith cursor placed where double click

This is a chopped spreadsheet. the sheet-add dialog must be activated by double click in the sheet tab area. the sheet-add icon does not produce the error.
Comment 3 Erike Magegere 2017-04-21 13:56:20 UTC
Created attachment 132735 [details]
after double click

this dialog must be used to get the error
Comment 4 Erike Magegere 2017-04-21 13:57:59 UTC
Created attachment 132736 [details]
sheet added

just showing added sheet. right mouse the new sheet to get the delete sheet command
Comment 5 Erike Magegere 2017-04-21 14:03:53 UTC
Created attachment 132737 [details]
result after delete

this shows the cells with a red background created by the conditional formats.  These are to alert the user of a balance error on the sheet. note that cell L14 shows "Hold OK" rather than "Hold Error" generated by a balance mismatch thus the data has not changed and the cells should not be red.
Comment 6 Erike Magegere 2017-04-21 14:05:55 UTC
Created attachment 132738 [details]
sample sheet used to produce screen shots

Spreadsheet with personal data and labels removed.
Comment 7 Erike Magegere 2017-04-21 14:09:06 UTC
I have attached cut spreadsheet and screen shots showing to get to the error.
Comment 8 Erike Magegere 2017-04-21 14:14:43 UTC
I have reviewed the attachments and noticed and error in description on the "result after delete" screen shot (comment 5). The red background is not created by the conditionals, it is the normal background.  The conditionals apply a style that has a white background. (ie balance x = balance y - clear the red error notice)
Comment 9 Erike Magegere 2017-04-21 14:16:00 UTC
Status changed to UNCONFIRMED
Comment 10 Erike Magegere 2017-04-23 09:26:27 UTC
I have done the testing defined on the page https://wiki.documentfoundation.org/UserProfile
and the error still occurs

User Profile Reset: No ==> Yes
Comment 11 m_a_riosv 2017-04-23 12:12:45 UTC
The issue I can see.
- Open the sample file.
- J13 and L14 has not background color.
- Insert a new sheet.
- Delete de new sheet.
- J13 and L14 has now background color.
Hard recalc and enable and disable autocalculta doesn't solve the issue.


Version: 5.3.2.2 (x64)
Build ID: 6cd4f1ef626f15116896b1d8e1398b56da0d0ee1
CPU Threads: 4; OS Version: Windows 6.19; UI Render: default; Layout Engine: new; 
Locale: es-ES (es_ES); Calc: group
Version: 5.2.7.1
Build ID: bf0fa7b86c7c0592941ede29fca6fafff642a948
CPU Threads: 4; OS Version: Windows 6.2; UI Render: GL; 
Locale: es-ES (es_ES); Calc: group
Comment 12 m_a_riosv 2017-04-23 12:25:19 UTC
It's also in master.
Version: 5.4.0.0.alpha0+
Build ID: 100e00fd3273536ebff130cfddc5da2b1fe609b1
CPU threads: 4; OS: Windows 6.19; UI render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2017-04-20_05:12:24
Locale: es-ES (es_ES); Calc: CL

First version with the issue.
Versión: 4.2.0.0.beta1
Id. de compilación: f4ca7b35f580827ad2c69ea6d29f7c9b48ebbac7

Last version without the issue.
Versión: 4.1.6.2
Id. de compilación: 40ff705089295be5be0aae9b15123f687c05b0a

It happens when the new sheet it's inserted to the left but not to the right.
Comment 13 raal 2017-05-13 20:49:47 UTC Comment hidden (obsolete)
Comment 14 Xisco Faulí 2017-06-04 19:30:59 UTC
Just for the record, inserting a new sheet and deleting it didn't make the bug to appear for me, however, duplicating the sheet and deleting it does
Comment 15 Xisco Faulí 2017-06-04 19:54:12 UTC
The bisection done in comment 13 seems incorrect, since the code changed in that commit is in sw. I've bisected it again and it pointed me to this commit:

author	Kohei Yoshida <kohei.yoshida@gmail.com>	2013-07-30 19:27:02 (GMT)
committer	Kohei Yoshida <kohei.yoshida@gmail.com>	2013-07-31 03:50:02 (GMT)
commit 0277792d169d66ad24734504ff33d2ec7d52ebaf (patch)
tree 1f1968f9c65ccfd8184f6855a60e887805a2786d
parent 441e70aee90e83a9f8782a3f84482db86b857b87 (diff)
Rework reference update in conditional formatting and cell validation.
No tests are written for this yet.

Adding Cc: to Kohei Yoshida
Comment 16 Markus Mohrhard 2017-06-25 22:11:36 UTC
Actually there are two independent issues that cause the update problem. The commit identified through bibisecting misses the updates to conditional format position (as handled by aSrcPos) and a later commit missed that formula listeners are updated independently after the conditional format update and therefore updated twice.
Comment 17 Commit Notification 2017-06-27 19:59:24 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "master":

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

add way to handle update refs for addresses, related tdf#107289

It will be available in 6.0.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 18 Commit Notification 2017-06-27 21:15:49 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "master":

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

fix conditional format source position during insert/deleting tabs, tdf#107289

It will be available in 6.0.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 19 Commit Notification 2017-07-27 17:53:02 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "master":

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

add test for update address code, related tdf#107289

It will be available in 6.0.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.