Bug 135514 - calc: formula: 'label' references not properly adapted when moving cells | was: identical formulae give different values
Summary: calc: formula: 'label' references not properly adapted when moving cells | wa...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.5.1 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Calculate
  Show dependency treegraph
 
Reported: 2020-08-06 22:52 UTC by TorrAB
Modified: 2023-07-28 20:34 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
file with erroneous result (17.38 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-08-06 22:52 UTC, TorrAB
Details
file with addition (8.63 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-08-14 00:46 UTC, TorrAB
Details

Note You need to log in before you can comment on or make changes to this bug.
Description TorrAB 2020-08-06 22:52:25 UTC
Created attachment 164017 [details]
file with erroneous result

File bad.ods: TOy et xx are given by identical formulae (='TOyH'+'TOxK') but have different values! (the value of xx is correct.)
 May be related to Bug 134485.
Comment 1 m_a_riosv 2020-08-08 00:56:34 UTC
Seems the file was saved in a inconsistent state.

Doing a hard-recalc Menu/Data/Calculate/Recalculate hard, solves the issue.

What could matter is if there are steps to generate the inconsistent state.
Comment 2 TorrAB 2020-08-09 20:37:45 UTC
	Editing the formula B21 without changing it (eg, deleting ‘3’ and restoring it) forces the update of B25 to the correct value.
Comment 3 TorrAB 2020-08-09 21:09:31 UTC
(In reply to m.a.riosv from comment #1)
> Seems the file was saved in a inconsistent state.
What is that? If LO saves in such a state, is this not a bug? 
> Doing a hard-recalc Menu/Data/Calculate/Recalculate hard, solves the issue.

That's a work-around, it does not ‘solve the issue’—which result can be trusted and when is a result wrong? 

Actually, selecting B25 and hitting f9 recalculates —not ‘hard’. But why should I suspect this formula (or any other) needs recalculation?
Comment 4 m_a_riosv 2020-08-10 07:02:29 UTC
I don't know if it was LO saving this file in an inconsistent state.

If you have the steps to arrive at save in an incorrect state please detail them.

Hard recalc is there from the beginning for something. And also there are options about recalculate opening the file in Menu/Tools/Options/LibreOffice calc/Formula, I guess also for something.
Comment 5 Xisco Faulí 2020-08-11 08:53:49 UTC
Hello,
Please mention the steps to generate such a file from scratch
Comment 6 TorrAB 2020-08-14 00:46:48 UTC
Created attachment 164291 [details]
file with addition

	Bad.ods: c=a+b=B3=7, OK
	Select B1, hit ^x; B1 is blank, B3=3, OK.
	Select cells B2:C2, drag them up; B1 is now 3, but B3=6—wrong, since B2 is blank.
	Select B2, hit ^v; B2 is now 4 (B1 and B2 have been exchanged), but B3 remains 6—false.
Comment 7 b. 2020-11-01 06:57:27 UTC
hello @TorrAB@Yahoo.com, 

nice sample of 'nagging spreadsheets', ;-) 

imho initial fail B2 isn't set 'dirty' or 'changed' when you 'steal' the content with a mousedrag, opposite to what happens when you use ctrl-x, 

(you can also move single cells with the mouse by [click - shift-click - click-drag])

(additional fail: if you 'throw' the 'ctrl-x-ed' content of B1 somewhere else on the sheet it's calculated in B3, in old versions only the cutted value?, in 7.1 you can even calculate with cells moved that way)

(probably it's dependent / affected by settings regarding 'automatically adapt ...' i'm not a pro in that) 

workarounds: 

- use keyboard for such operations, 

- 'non changing edit' of B3 recalculates, which F9 and ctrl-shift-F9 don't do :-(

- give up using label references in formulae ... as ex$el did in ver. 2010, 

- wait for an interested developer, 

fail already in 3.5.1.2, assume 'inherited', 

setting 'new', 

trying to raise importance (not allowed to me, would somebody with app. karma do?) as: 

- bug may affect plenty other operations as well, 

- bug creates confusing sheets, 

- 'trapping errors' may spread, 

- recalc doesn't work, 

- even 'forced recalc' keps wrong results,
Comment 8 TorrAB 2020-11-01 18:13:26 UTC
	Suggested fix:
0: link to its label a cell referred to in another cell by its label;
1: prevent any attempt to move a linked cell alone, with a pop-up: ‘This cell is linked to its label, must be moved with it.’ The user could select the cell and its label, and move the pair or (why not?) a group of such pairs.
Comment 9 QA Administrators 2022-11-02 03:35:06 UTC
Dear TorrAB,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug