Download it now!
Bug 74014 - Editing: Cell formula not updating on redo, even with a forced recalculation
Summary: Editing: Cell formula not updating on redo, even with a forced recalculation
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.2.0.3 rc
Hardware: Other All
: highest critical
Assignee: Kohei Yoshida
URL:
Whiteboard: target:4.3.0 target:4.2.1
Keywords: regression
: 74756 (view as bug list)
Depends on:
Blocks: mab4.2
  Show dependency treegraph
 
Reported: 2014-01-24 11:46 UTC by Jaise James
Modified: 2015-12-22 01:33 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample document (33.27 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-01-24 11:47 UTC, Jaise James
Details
sample option (111.43 KB, image/png)
2014-01-28 04:21 UTC, Jaise James
Details
sample 2 (42.10 KB, image/png)
2014-01-28 04:23 UTC, Jaise James
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jaise James 2014-01-24 11:46:41 UTC
Cell formula not updating.

Step to Produce :

Method 1.

1. Column having values 20, 10, 25, 30, 10. & Sum in the 6th row.

2. Just cut the 1-5 row cell values, sum cell is become zero. 

3. Just undo the operation, Values comes back in cell, but still sum cell is zero.

4. Press f9 in sum cell. No change in the sum value.

5. You need type a value in 1-5 cell to update the sum formula or close & open file again to update.


Method 2.

1. Column having values 20, 10, 25, 30, 10. & Sum in the 12th row cell.

2. Copy first 4 values.

3. Paste using un-formated[ Paste special option] in 5-8 cell.

4. No change in the sum value.

5. Press f9 in sum cell. No change in the sum value.

6. You need type a value in 1-8 cell to update the sum formula or close & open file again to update.
Comment 1 Jaise James 2014-01-24 11:47:33 UTC
Created attachment 92722 [details]
Sample document

sample document for testing.
Comment 2 Jorendc 2014-01-24 21:46:48 UTC
Reproducible, tested using Mac OSX 10.9 with LibreOffice Version: 4.3.0.0.alpha0+
Build ID: 8fd7a53d3cf1ed788c705cafb443801203787c9d
TinderBox: MacOSX-x86@49-TDF, Branch:master, Time: 2014-01-22_00:10:03

Not reproducible using LibreOffice Versie: 4.1.4.2 
Build ID: 0a0440ccc0227ad9829de5f46be37cfb6edcf72

I'm not that experienced with Calc-matter, so I hope someone else can determine it's a big bug or not :). Marking as regression for sure.

Kind regards,
Joren
Comment 3 Jorendc 2014-01-24 21:56:48 UTC
Discussed this one on IRC with Markus and Joel. Marking as Critical HIGHEST. Will affect many users and it's a pretty nasty bug. Thanks for reporting!

@Eike: ping :). Looks a nasty one.

Kind regards,
Joren
Comment 4 m.a.riosv 2014-01-24 23:33:45 UTC
Reproducible.
Win7x64Ultimate
Version: 4.2.0.3 Build ID: c63c03decdf780d8fb80823950665b782ec9ecd0
Version: 4.2.1.0.0+ Build ID: 23221e48495262d0384c9169a0d8a01db8a5dab5
         TinderBox: Win-x86@42, Branch:libreoffice-4-2, Time: 2014-01-21_13:02:45
Version: 4.3.0.0.alpha0+
Build ID: 77637324abc193d831bb4a0fa6f9a91ef3601960
         TinderBox: Win-x86@39, Branch:master, Time: 2014-01-22_16:19:04

No issue with:
Version: 4.1.6.0.0+ Build ID: 873be8f3ff28fd06b531b17d2c7cc41cbc1385e

In both cases hard recalc does the job.
Maybe the cells aren't set as dirty after undo.
Comment 5 Kohei Yoshida 2014-01-28 02:17:41 UTC
I don't quite get Method 2.  My questions are inline.

(In reply to comment #0)

> Method 2.
> 
> 1. Column having values 20, 10, 25, 30, 10. & Sum in the 12th row cell.

Do you mean put values in A1:A5 and put formula "=SUM(A1:A5)" in A12? or is the formula "=SUM(A1:A11)"?

> 2. Copy first 4 values.

I assume copying A1:A4?

> 3. Paste using un-formated[ Paste special option] in 5-8 cell.

This I don't get.  When I paste-special at this point, I get the dialog containing "Selection", "Operation", "Options", "Shift cells".  But your step seems to suggest the other paste special dialog.

Could you clarify on this?

Method 1, on the other hand, was reproducible, and I have a fix at the ready.
Comment 6 Commit Notification 2014-01-28 02:21:09 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

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

fdo#74014: Write unit test for this first.



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 2014-01-28 02:21:23 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

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

fdo#74014: Broadcast cells on undoing of "cut".



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 Kohei Yoshida 2014-01-28 02:54:09 UTC
4.2 Backport request: https://gerrit.libreoffice.org/7709
Comment 9 Jaise James 2014-01-28 04:21:13 UTC
Created attachment 92899 [details]
sample option
Comment 10 Jaise James 2014-01-28 04:22:24 UTC
(In reply to comment #5)
> I don't quite get Method 2.  My questions are inline.
> 
> (In reply to comment #0)
> 
> > Method 2.
> > 
> > 1. Column having values 20, 10, 25, 30, 10. & Sum in the 12th row cell.
> 
> Do you mean put values in A1:A5 and put formula "=SUM(A1:A5)" in A12? or is
> the formula "=SUM(A1:A11)"?
> 
> > 2. Copy first 4 values.
> 
> I assume copying A1:A4?
> 
> > 3. Paste using un-formated[ Paste special option] in 5-8 cell.
> 
> This I don't get.  When I paste-special at this point, I get the dialog
> containing "Selection", "Operation", "Options", "Shift cells".  But your
> step seems to suggest the other paste special dialog.
> 
> Could you clarify on this?
> 
> Method 1, on the other hand, was reproducible, and I have a fix at the ready.


Picture is attached. Sorry for confusing with menu paste special.
Comment 11 Jaise James 2014-01-28 04:23:49 UTC
Created attachment 92900 [details]
sample 2
Comment 12 Commit Notification 2014-01-28 17:09:14 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

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

fdo#74014: Better fix, to re-use existing method.



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 2014-01-29 14:10:38 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=26f9a971abe37cee355744da1af76092e0fe11df&h=libreoffice-4-2

fdo#74014: Broadcast cells on undoing of "cut".


It will be available in LibreOffice 4.2.1.

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 Kohei Yoshida 2014-01-29 15:06:20 UTC
(In reply to comment #10)

> Picture is attached. Sorry for confusing with menu paste special.

Thanks. This distinction is important since the paste icon and the paste dialog have two totally different code paths.
Comment 15 Kohei Yoshida 2014-01-29 15:08:47 UTC
And it's interesting that the bug hits only with "Unformatted text" paste.
Comment 16 Commit Notification 2014-01-29 20:41:47 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

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

fdo#74014: More on broadcasting at appropriate places.



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 17 Commit Notification 2014-01-29 20:42:05 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

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

fdo#74014: Add unit test for pasting an unformatted text into cells.



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 2014-01-29 20:42:21 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

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

fdo#74014: Broadcast changes during undo and redo after paste.



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 Kohei Yoshida 2014-01-29 21:00:42 UTC
These additional changes fixed scenario 2, plus undo and redo after that, which was not a part of the original report.

Backport request for 4.2 is on-going.
Comment 20 Commit Notification 2014-01-30 22:38:52 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

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

fdo#74014: Brodcast only when pasting, not during file import.



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 21 Commit Notification 2014-01-30 23:16:13 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=383e5543593848cbd1458d5c5dad5e7b7b17ee09&h=libreoffice-4-2

fdo#74014: More on broadcasting at appropriate places.


It will be available in LibreOffice 4.2.1.

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 22 Commit Notification 2014-01-30 23:41:37 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=92346fb7714ca7c6a467771d8a8b01305c1b17d1&h=libreoffice-4-2

fdo#74014: Broadcast changes during undo and redo after paste.


It will be available in LibreOffice 4.2.1.

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 23 Kohei Yoshida 2014-01-30 23:43:10 UTC
k.  All fixes are in the 4.2.x branch.  I'll mark this fixed.
Comment 24 m.a.riosv 2014-02-11 03:09:42 UTC
Sorry Kohei but still reproducible for me with:
Win7x64Ult.
Version: 4.2.1.0.0+ Build ID: 684a0308dcb847f816967202ba87f536b83dcb4e
         TinderBox: Win-x86@42, Branch:libreoffice-4-2, Time: 2014-02-10_23:09:14

With the sample file in comment#1
- Deleting D2:D6
- D16 recalc the sum => 72
- Undo
- D16 doesn't recalc remains 72
- F9, D16 recalc the sum => 195
Comment 25 Kohei Yoshida 2014-02-11 06:04:56 UTC
4.2 backport: https://gerrit.libreoffice.org/7989
Comment 26 Commit Notification 2014-02-11 06:05:02 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

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

fdo#74014: Additional test.



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 27 Commit Notification 2014-02-11 06:05:17 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

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

fdo#74014: Broadcast here....



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 28 Commit Notification 2014-02-11 12:31:07 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=04b11e8d5411f687fb573f94d6ed58ace7c424c4&h=libreoffice-4-2

fdo#74014: Broadcast here....


It will be available in LibreOffice 4.2.1.

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 29 Kohei Yoshida 2014-02-11 13:01:12 UTC
Fixed again.
Comment 30 m.a.riosv 2014-02-13 22:34:08 UTC
Thanks Kohei.

Verified fixed.

Win7x64Ultimate
Version: 4.2.1.0.0+ Build ID: 58df669ac734f4740cf1112867edb808789aae43
TinderBox: Win-x86@42, Branch:libreoffice-4-2, Time: 2014-02-12_13:26:56
Comment 31 Jaise James 2014-02-14 04:25:43 UTC
Thanks for swift reponse & fixing the bug. 

I will install & check the changes. 

:-)
Comment 32 sophie 2014-02-14 13:56:46 UTC
*** Bug 74756 has been marked as a duplicate of this bug. ***
Comment 33 Teo91 2014-07-15 15:24:34 UTC
I can confirm this bug again in LO 4.2.5.2, LO 4.3.0.2 (RC2) and LO 4.4.x (daily build 11th July).

Comment #1 by Jaise James perfectly explains the steps to reproduce the issue: it seems to be exactly the same bug.

Is it possible the unit test failed? Or it was temporarily disabled during the development process and not enabled again?

Also note the Whiteboard is targeting 4.3.0 but the fix isn't currently available.
Comment 34 Jean-Baptiste Faure 2014-07-19 15:34:46 UTC
Works as expected for me with LibreOffice 4.3.1.0.0+ build at home under Ubuntu 14.04 x86-64

According to the help (search "recalculate"), F9 force to recalculate the modified formulas. To force to recalculate all formulas use ctrl+maj+F9

Best regards. JBF
Comment 35 Teo91 2014-07-23 12:41:16 UTC
I can still confirm the bug on LO 4.3.0 RC3, which should became the final release. Same with LO 4.4 daily (15th july) and LO 4.2.5.2.

Steps to reproduce:

1. Open a new spreadsheet, with A1 = 10, A2 = 20, A3 = 30

2. Set A4 = SUM(A1:A3), so you will see A4 = 60 (A1+A2+A3= 10+20+30 = 60)

3. Delete A2 and A4 will correctly become 40 (A1+A2+A3= 10+0+30 = 40)

4. Undo the change: A2 will become again 20, but A4 remains 40 (!!)

5. Press f9 in A4: no change in the sum value. Press Ctrl+Maiusc+F9: it works and A4 becomes 60

6. Try to undo/redo the change multiple times: one time you will see a correct recalculation, one time not.

The Whiteboard however is still targeting 4.3.0.
Comment 36 ign_christian 2014-07-23 13:36:32 UTC
(In reply to comment #35)
Hi Teo91, I think bug with undo after delete (your case) has been reported in Bug 80846. So it's different from this bug.
Comment 37 Teo91 2014-07-23 14:15:32 UTC
@ign_christian
Thank you, that is the correct bug indeed.
I close again this report, reverting it to RESOLVED FIXED.
Comment 38 Robinson Tryon (qubit) 2015-12-22 01:33:14 UTC
Removing comma from Whiteboard (please use a space to delimit values in this field)
https://wiki.documentfoundation.org/QA/Bugzilla/Fields/Whiteboard#Getting_Started
[NinjaEdit]