Bug 111428 - Formula cells not recalculated after column was inserted and in a shifted column a formula cell is edited/added when the next column is empty (EDITING)
Summary: Formula cells not recalculated after column was inserted and in a shifted col...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.3.0.0.beta2
Hardware: All All
: high major
Assignee: Eike Rathke
URL:
Whiteboard: target:6.0.0 target:5.4.3 target:5.3.8
Keywords: bibisected, bisected, regression
: 112640 114143 (view as bug list)
Depends on:
Blocks: Calculate
  Show dependency treegraph
 
Reported: 2017-08-07 06:48 UTC by John A. Paravantis
Modified: 2017-11-30 13:12 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John A. Paravantis 2017-08-07 06:48:42 UTC
Description:
AutoCalculate stops working when a new column is inserted in a LibreOffice 5.3.0.2 x64 (Windows 10)! To re-enable AutoCalculate, one must close and reopen the document.

To confirm that it is a bug, this issue was discussed at

https://ask.libreoffice.org/en/question/120044/autocalculate-stops-working-when-column-is-inserted/

and it has been confirmed to occur in version: 5.3.1.2, Build ID: 1:5.3.1-0ubuntu2 as well.

Steps to Reproduce:
1. Start a new spreadsheet and confirm that AutoCalculate is enabled.
2. Type in a number in cell A1.
3. Type in another number in Cell B1.
4. In cell C1 insert the formula `=A1+B1`.
5. Confirm that the sum in C1 works correctly; try changing the values in A1 and B1 to verify that is recalculates correctly.
6. Now select column C and insert an empty column to its left, i.e. between B and C.
7. Edit the sum formula (which is now located) in cell D1 to `=A1+B1+C1`.
8. Now type in a number in cell C1.
9. Confirm that the sum in cell D1 is not updated correctly, despite the fact that AutoCalculate is enabled. Hard recalculation works.
10. Close and reopen the spreadsheet.
11. Finally, confirm that recalculate works correctly at all times, now that the spreadsheet was reopened.

The bug has been confirmed by other users, the same behavior was observed for `=$A$1+$B$1+$C$1` on a version 5.3.1.2 (Build ID: 1:5.3.1-0ubuntu2) system.

Actual Results:  
As described above, it was confirmed that AutoCalculate stops working when a new column is inserted, until the spreadsheet is closed and reopened.

Expected Results:
When AutoCalculate is enabled, (1) automatic recalculation should occur continuously; also, (2) there should be no difference in behavior before and after closing and reopening a spreadsheet.


Reproducible: Always

User Profile Reset: No

Additional Info:


User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36
Comment 1 Mike Kaganski 2017-08-07 07:16:34 UTC
Confirmed with:

Version: 5.3.0.0.beta2 (x64)
Build ID: a7e30712ad6d8bc9286007b37aa581983e0caba3
CPU Threads: 4; OS Version: Windows 6.19; UI Render: default; Layout Engine: new; 
Locale: ru-RU (ru_RU); Calc: CL

Version: 5.4.0.3 (x64)
Build ID: 7556cbc6811c9d992f4064ab9287069087d7f62c
CPU threads: 4; OS: Windows 6.19; UI render: default; 
Locale: ru-RU (ru_RU); Calc: group

and also with current master.

NOT reproducible with: Version: 5.2.5.1 (x64)
Build ID: 0312e1a284a7d50ca85a365c316c7abbf20a4d22
CPU Threads: 4; OS Version: Windows 6.19; UI Render: default; 
Locale: ru-RU (ru_RU); Calc: group
Comment 2 Mike Kaganski 2017-08-07 07:36:55 UTC
/cygdrive/d/sources/bibisect-win32-5.3
$ git bisect log
# bad: [a374222bc87bd9e75ea2f1ca45d189932a1967f8] source sha:aa09fd58bd499a2a2c3a32c5f613892bad54076c
# good: [defb73f1c6e2a66dbd21ba89e684f57427e8bc4b] source sha:5b168b3fa568e48e795234dc5fa454bf24c9805e
git bisect start 'master' 'oldest'
# bad: [0b4408f0568ad1da0797543c0ee2955c386267ee] source sha:8f7886c742cae5e012e52029c20925aa7b0fb6ea
git bisect bad 0b4408f0568ad1da0797543c0ee2955c386267ee
# good: [16b554fa5f3a3d2723e78d894d644ac9303a7991] source sha:50a6f3d51f32e7176c3b2d036c60bb48d51d6a1a
git bisect good 16b554fa5f3a3d2723e78d894d644ac9303a7991
# bad: [1d5414e6dc71de667a2e7457f4a169c3575a4a70] source sha:f16c803e7f5186632adeffc2dad579cf2c720b15
git bisect bad 1d5414e6dc71de667a2e7457f4a169c3575a4a70
# bad: [5942c07976de306d75affaeadcde1f3697bc4fd3] source sha:4fc3c8a3df485f6dccdcb2c51c6266fbd0dace3e
git bisect bad 5942c07976de306d75affaeadcde1f3697bc4fd3
# bad: [88223d9fd206d9710ad6c3bde7ad927e19f333cd] source sha:aaa5a098f4a3644a6f78cafa1c86f1db12c4f6ed
git bisect bad 88223d9fd206d9710ad6c3bde7ad927e19f333cd
# bad: [a0052c85b4b4c856a5c028bd872b80df429343f2] source sha:8babcb7e669ce2f752945c1f89647b759ec568d3
git bisect bad a0052c85b4b4c856a5c028bd872b80df429343f2
# good: [0059e4b01ce8371b8a9716900ffb9bf69376a603] source sha:3d70765218986abba8b6d7c8e3cadd83a62ee035
git bisect good 0059e4b01ce8371b8a9716900ffb9bf69376a603
# good: [33f290342aeaa41e30876a1d1ea4f986b09ab344] source sha:01767d5d9d43d4ef4bd948f00a1cd2c113714b20
git bisect good 33f290342aeaa41e30876a1d1ea4f986b09ab344
# good: [3a47c5610f4d69690600e4becadab0737f1fd47c] source sha:bf5110d0704ba95d9a080f7dea64162c346317a9
git bisect good 3a47c5610f4d69690600e4becadab0737f1fd47c
# bad: [8a5470a28b8289c824ed171b6af852ba58801693] source sha:d03d7a79406c4bd25a776a4f7247588662b121b0
git bisect bad 8a5470a28b8289c824ed171b6af852ba58801693
# good: [54b1823ada6c260b0fc5f0602d4c381331d8fafd] source sha:b569bc15c6236a3e0f9f4ef6f138dbf4a22cb8d1
git bisect good 54b1823ada6c260b0fc5f0602d4c381331d8fafd
# good: [c99ca3a12af0a7d7d9ee4881a5ac34912ef5d9e4] source sha:0473f6fc0445272b1e9d01ca9166d4fae58a5a56
git bisect good c99ca3a12af0a7d7d9ee4881a5ac34912ef5d9e4
# bad: [cebfa472b43a46a9231675da7a202db74a9bba66] source sha:e57a5905fb2975307af654710430d0a876dbd061
git bisect bad cebfa472b43a46a9231675da7a202db74a9bba66
# first bad commit: [cebfa472b43a46a9231675da7a202db74a9bba66] source sha:e57a5905fb2975307af654710430d0a876dbd061

https://cgit.freedesktop.org/libreoffice/core/commit/?id=e57a5905fb2975307af654710430d0a876dbd061

author	Kohei Yoshida <kohei.yoshida@gmail.com>	2016-07-17 00:01:48 (GMT)
committer	Kohei Yoshida <libreoffice@kohei.us>	2016-07-17 13:00:36 (GMT)
commit	e57a5905fb2975307af654710430d0a876dbd061
tree	364527c7b09f9704e6c6ece7ca473c9e2030177f
parent	0473f6fc0445272b1e9d01ca9166d4fae58a5a56
Use mdds' event callback to count formula blocks in each column.
And use it to speed up certain formula related operations.
Comment 3 m.a.riosv 2017-09-25 21:34:32 UTC
*** Bug 112640 has been marked as a duplicate of this bug. ***
Comment 4 prossin 2017-10-07 14:05:08 UTC
This is a VERY ANNOYING bug. I suggest to change importance to critical. I see this same bug in every update for years.
This HUGE BUG becomes more relevant because if you save a document in native ods format with inconsistent values in some cells, as described in the procedure, recalc does not trigger on loading.

-------------------------------------
Confirmed with Version: 5.4.2.2 (x64)

Build ID: 22b09f6418e8c2d508a9eaf86b2399209b0990f4
Thread CPU: 4; SO: Windows 6.1; Resa interfaccia: predefinito; 
Versione locale: it-IT (it_IT); Calc: single
Comment 5 Mike Kaganski 2017-10-07 14:48:48 UTC
(In reply to prossin from comment #4)

Please don't modify issue fields unless you understand their meaning. That requires at least trying to read their names carefully (e.g., the Version field has "earliest affected" clarification right below for a reason).

You couldn't have this same bug for years, because it was introduced in 5.3, which was released in the beginning of this year. Yes, it is rather important, but it doesn't qualify for critical - the importance categories have the project's established meanings, not necessarily what natural language implies.

I raise the importance, though, because this is a regression.
Comment 6 prossin 2017-10-07 15:53:46 UTC
(In reply to Mike Kaganski from comment #5)
> (In reply to prossin from comment #4)
> 
> Please don't modify issue fields unless you understand their meaning. That
> requires at least trying to read their names carefully (e.g., the Version
> field has "earliest affected" clarification right below for a reason).
> 
> You couldn't have this same bug for years, because it was introduced in 5.3,
> which was released in the beginning of this year. Yes, it is rather
> important, but it doesn't qualify for critical - the importance categories
> have the project's established meanings, not necessarily what natural
> language implies.
> 
> I raise the importance, though, because this is a regression.

I apologize for the mistakes you pointed me out. You're right, this is a fairly new bug but very often I have problems because recalc does not trigger on loading. If something goes wrong with editing (and strange things could happens also with older versions, believe me) when I open a document I cannot be 100% sure that formulas are calculated correctly. So I don't trust LibreOffice Calc anymore from this point of view. It's a pity!
Comment 7 grantkzn 2017-10-23 11:09:51 UTC Comment hidden (no-value)
Comment 8 Eike Rathke 2017-11-01 18:56:32 UTC
Investigating.
Comment 9 Eike Rathke 2017-11-02 11:57:49 UTC
Minimal reproducer:
* A1: 1
* B1: =A1
* insert column left of B
* edit formula cell of then C1 to =A1+1
* change value in A1 => no recalc in C1

Does not occur if before inserting the column there's a formula cell in column C (i.e. the column right to the one of which the formula cell is edited).
Comment 10 Commit Notification 2017-11-02 12:00:28 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

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

Resolves: tdf#111428 implement CellStoreEvent::swap() in ScColumn::SwapCol()

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 11 Eike Rathke 2017-11-02 12:10:45 UTC
Pending review https://gerrit.libreoffice.org/44210 for 5-4
Comment 12 Commit Notification 2017-11-02 16:18:21 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

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

Unit test for CellStoreEvent::swap() in ScColumn::SwapCol(), tdf#111428

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 13 Commit Notification 2017-11-03 13:47:27 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

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

Resolves: tdf#111428 swap (only) ScColumn::mnBlkCountFormula

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 14 Commit Notification 2017-11-03 14:11:15 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-5-4-3":

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

Resolves: tdf#111428 swap ScColumn::mnBlkCountFormula

It will be available in 5.4.3.

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 15 Commit Notification 2017-11-03 22:33:26 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-5-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=76c54edc8ee972c63da8ed1f5d6ab75ea552da46&h=libreoffice-5-4

Resolves: tdf#111428 swap ScColumn::mnBlkCountFormula

It will be available in 5.4.4.

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 16 Xavier Van Wijmeersch 2017-11-04 18:41:21 UTC
Tested using comment 9 and its working 

Version: 6.0.0.0.alpha1+
Build ID: e3530d2c9d5dc98c6bacf243c163d651624e1ba6
CPU threads: 8; OS: Linux 4.9; UI render: default; VCL: gtk3; 
Locale: nl-BE (en_US.UTF-8); Calc: group
Comment 17 prossin 2017-11-05 22:34:10 UTC
Version 5.4.3.2 works fine, too.

The only problem I see is that if I open a document .ods with auto recalc 'broken' because saved with a previous 'buggy' version, the loading of the file does not trigger recalc. IMHO, the problem is mostly not related to this bug, but to the lack of the option 'recalc on loading' (not an option for ods created by LibreOffice).

Versione: 5.4.3.2 (x64)
Build ID: 92a7159f7e4af62137622921e809f8546db437e5
Thread CPU: 4; SO: Windows 6.1; Resa interfaccia: predefinito; 
Versione locale: it-IT (it_IT); Calc: single
Comment 18 Eike Rathke 2017-11-07 13:42:24 UTC
(In reply to prossin from comment #17)
> lack of the option 'recalc on loading' (not an option
> for ods created by LibreOffice).
You can always do a manual hard recalc (Shift+Ctrl+F9) of the entire document if you suspect you encountered a faulty saved document.
Comment 19 Commit Notification 2017-11-09 16:29:52 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

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

Resolves: tdf#111428 swap ScColumn::mnBlkCountFormula

It will be available in 5.3.8.

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 20 Kevin Suo 2017-11-30 13:12:21 UTC
*** Bug 114143 has been marked as a duplicate of this bug. ***