Bug 80062

Summary: EDITING: Formula not recalculated after Undo on cell that is referred in that formula
Product: LibreOffice Reporter: Cor Nouws <cno>
Component: CalcAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED DUPLICATE    
Severity: critical CC: cno, geromanas, miguelangelrv, ogaia, suokunlong, zhnmju123
Priority: medium Keywords: regression
Version: 4.3.0.0.beta2   
Hardware: Other   
OS: Linux (All)   
Whiteboard:
Crash report or crash signature: Regression By:
Attachments: test spreadsheet formula undo
Sample demonstrating comment #4

Description Cor Nouws 2014-06-15 20:01:53 UTC
I'll attach a sample document
- go to B4
- DELL
  > C4 shows empty
- down 
- Ctrl+Z
  > B4 shows x, but C4 remains Empty
Comment 1 Cor Nouws 2014-06-15 20:03:17 UTC
Created attachment 101120 [details]
test spreadsheet formula undo
Comment 2 Cor Nouws 2014-06-15 20:04:52 UTC
Sorry, is in 4.3.0 beta2
Was OK  in 4.3.0 beta1 !  > regression

AFAICS, all settings for reload / update cells etc are the same in all versions that I tested
Comment 3 m_a_riosv 2014-06-15 20:31:44 UTC
Hi Cor,

same issue with:
Win7x64Ultimate
Version: 4.2.5.2 Build ID: 61cb170a04bb1f12e77c884eab9192be736ec5f5
Version: 4.4.0.0.alpha0+Win-x86@39, Branch:master, Time: 2014-06-15_05:02:39
Version: 4.3.0.0.beta2 Win-x86@42,Branch:libreoffice-4-3,Time:2014-06-15_05:32:11
Version: 4.4.0.0.alpha0+Win-x86@39, Branch:master, Time: 2014-06-15_05:02:39

Hard recalc [Shift+Ctrl+F9] gets the correct values.
Comment 4 Modestas Vainius 2014-07-13 07:20:27 UTC
I can confirm this issue on both 4.2.5.2 (Linux) and 4.3.0.2 (RC2) (windows). It seems to affect more or less all formulas. But interestingly enough, some formulas are recalculated on undo and it does seem to depend on row, column, sheet and even reference count/width/height in the formula.

I attach speadsheet "undo_doesnt_recalc.ods" demonstrating this. All sheets contain the same content. However:

1) If you delete content of any cell in Sheet1 Row 1 and undo it, you can see as Row 1 formulas are recalculated and others are not. If you delete content on other rows, no formulas are recalculated.
2) If you delete content of any cell in Sheet2 Row 2 and undo it, you can see as Row 2 formulas are recalculated and others are not. If you delete content on other rows, no formulas are recalculated.
3) If you delete content of any cell in Sheet3 Row 3 and undo it, you can see as Row 3 formulas are recalculated and others are not. If you delete content on other rows, no formulas are recalculated.

Do you see the pattern? It seems as if the same index variable in "reference affected" loop is reused for row, column and sheet.

While not demonstrated in "undo_doesnt_recalc.ods", the rules above change if formula =COUNT($A$1:$C$3) is replaced with =COUNT($A$1:$C$2). Then deleting value in Sheet1.C1 no longer causes Row 1 formulas to recalculate. Likewise deleting value in Sheet2.C2 no longer causes Row 2 formulas to recalculate. So it seems to depend on range height and/or width as well.

This bug has almost already fooled me into sending wrong numbers to other people. I think it is fairly critical.
Comment 5 Modestas Vainius 2014-07-13 07:22:00 UTC
Created attachment 102686 [details]
Sample demonstrating comment #4
Comment 6 ign_christian 2014-07-13 10:23:43 UTC
*** Bug 80846 has been marked as a duplicate of this bug. ***
Comment 7 Kevin Suo 2014-07-13 13:58:47 UTC
Mark as a duplicate of bug 80846, see my comment there.

*** This bug has been marked as a duplicate of bug 80846 ***