Bug 78555 - EDITING: Formula cell loses result when moving (with auto calculate off).
Summary: EDITING: Formula cell loses result when moving (with auto calculate off).
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.2.3.3 release
Hardware: Other All
: medium critical
Assignee: Kohei Yoshida
URL:
Whiteboard: target:4.4.0
Keywords: regression
Depends on:
Blocks:
 
Reported: 2014-05-11 14:59 UTC by harryparry2011
Modified: 2014-07-31 14:37 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
table and calculation error under LO 4.2.3.3 (38.41 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-05-11 14:59 UTC, harryparry2011
Details
depiction of table and calculation error under LO 4.2.3.3 (97.99 KB, image/png)
2014-05-11 15:00 UTC, harryparry2011
Details

Note You need to log in before you can comment on or make changes to this bug.
Description harryparry2011 2014-05-11 14:59:03 UTC
Created attachment 98844 [details]
table and calculation error under LO 4.2.3.3

Win7 Home 64bit
LO 4.2.3.3 Build-ID: 882f8a0a489bc99a9e60c7905a60226254cb6ff0

Open the file attachements to see what I mean.

To reproduce:
1) Move left table up or to the upper left → data not lost
2) Move same table down or to the lower right → data lost
-> will affect right table
3) go to right table, add parameter in 1st row of y-values (H19) and remove it again within the edit mode
4) apply the logic to the full column of y-values → data is wrong
5) additionally, "undo" doesn't work

Works fine under Win7 Pro 64bit, LO 4.2.1.1 and 
Ubuntu 12.04 LTS, LO 3.5.7.2 Build-ID: 350m1 (Build:2)
Comment 1 harryparry2011 2014-05-11 15:00:49 UTC
Created attachment 98845 [details]
depiction of table and calculation error under LO 4.2.3.3
Comment 2 harryparry2011 2014-05-11 15:02:52 UTC
I'm sorry, you might have to download the Calc file with "right click -> save as". I don't know what this always happens.
Comment 3 Cor Nouws 2014-05-11 15:48:48 UTC
Hi harry,

thanks for reporting. I confirm the problem in steps 1 and 2.
also pls note that after moving the table up/left and doing Undo, formulas are lost.

wrt your 2nd problem (steps 3-5) I do not understand very well what you mean. If it's a different problem, also it's better to report a separate issue..
Cheers,
Cor
Comment 4 Cor Nouws 2014-05-11 16:00:22 UTC
OK, steps 1 and 2 (the first problem):

can't reproduce in 4.2.2.1
4.2.3.1 and 4.2.3.2 and 4.2.3.3 crash when I move the selected table ..
I can reproduce in 4.2.4.2
Comment 5 Cor Nouws 2014-05-11 16:02:41 UTC
(In reply to comment #3)

> wrt your 2nd problem (steps 3-5) I do not understand very well what you
> mean. If it's a different problem, also it's better to report a separate
> issue..

It turns out that don't need to edit the cell.
I just pull down H19 to H28 and all values become 7, with the formules still referring to the cell in the correct row..
Comment 6 m_a_riosv 2014-05-11 20:57:30 UTC
With:
Win7x64Ultimate
Version: 4.2.3.3 Build ID: 882f8a0a489bc99a9e60c7905a60226254cb6ff0

The first is that the file has the Autocalculate off.

My observations:
- after undo not formula values are showed (maybe the only issue here *1), works fine with autocalculate on, also they are recovered after a [F9].
- comment#5, works fine with autocalculate on or a manual calculation[F9]

So works for me.

If enable Menu/Tools/Cells content/Autocalculate or [F9] doesn't work,
I think a resetting of the user profile could be tried to discard it,
https://wiki.documentfoundation.org/UserProfile

*1 works fine with:
Version: 4.2.5.0.0+ Build ID: 1b9f4a686c5f397db3bd996acf53e0ad2b5d9ded
   TinderBox: Win-x86@42, Branch:libreoffice-4-2, Time: 2014-05-10_08:15:00
Comment 7 harryparry2011 2014-05-12 23:16:41 UTC
Thanks for your responses!
The issue turned out to be a whole lot more different than I initially thought.
I was surprised autocalc is turned off, didn't notice that.

=======

  I've discovered the following:
Under LO 4.2.3.3 release (Build-ID: 882f8a0a489bc99a9e60c7905a60226254cb6ff0, Win7 Home 64bit), autocalc turns off automatically sometimes (not always), when trying to move a table with formulas up or down.
That seems to be the reason why autocalc is turned off, I'm sure I didn't do that on purpose


  Comment 3, 4, 5: having that in mind, steps 3-5 I've initially reported aren't really an issue, the behaviour of not applying formulas with autocalc off (unintentionally) is appropriate.


  @ m.a.r.iosv
Thanks for the answer!
For me, both moving tables and formula calculations don't work since autocalc turns off automatically.
Additionally, tables sometimes (not always) crash even with autocalculation turned off manually, too, what they shouldn't either.


  "Undo" funcionality: doesn' work either after autocalculation being turned off automatically, works well in new document with plain text without formulas

  Of course, the like of autocalc being turned off automacilly does effect the behaviour of other functions linked to it, such as diagrams being displayed wrong.


Autocalc, moving tables, undo and diagrams
work fine under Win7 Pro 64bit, LO 4.2.2.1 and
work fine under Unbuntu 12.04 LTS 64bit, LO 3.5.7.2 Build-ID: 350m1 (Build:2)
Comment 8 m_a_riosv 2014-05-13 00:30:23 UTC
Have you tried resetting the user profile?, sometimes solves strange issues.
Comment 9 harryparry2011 2014-05-13 17:42:10 UTC
(In reply to comment #8)
> Have you tried resetting the user profile?, sometimes solves strange issues.

Hi there, 

yes I did, without any success though. Cour Nouws could reproduce it in     comment #3.
Comment 10 ign_christian 2014-07-03 16:26:06 UTC
Have you tried LO 4.2.5.2 ? 
I just tried & it behave as expected (in Ubuntu 12.04x86)
Comment 11 ign_christian 2014-07-03 16:31:25 UTC
Undo bug is similar to Bug 80501
Comment 12 harryparry2011 2014-07-15 13:55:49 UTC
(In reply to comment #10)
> Have you tried LO 4.2.5.2 ? 
> I just tried & it behave as expected (in Ubuntu 12.04x86)

seems to work under 4.2.5.2, don't know if still available in 3.0, gonna try it next week when official release is out
Comment 13 Kohei Yoshida 2014-07-30 15:40:29 UTC
Turning on auto calculate makes the problem go away.
Comment 14 Kohei Yoshida 2014-07-30 16:16:00 UTC
BTW, auto calc is a document option, which means it gets saved with the document.
Comment 15 Kohei Yoshida 2014-07-30 18:10:42 UTC
I'm looking into this.
Comment 16 Commit Notification 2014-07-31 13:06:48 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

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

fdo#78555: Write 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 17 Commit Notification 2014-07-31 13:07:07 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

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

fdo#78555: Retain formula results when moving a range of 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-07-31 13:08:55 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

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

fdo#78555: Oopsy.



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-07-31 14:37:33 UTC
Fixed on master, and backport requests sent to gerrit.