Bug 124326 - Undo after drag&drop changes the original formula
Summary: Undo after drag&drop changes the original formula
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.3 all versions
Hardware: All All
: medium normal
Assignee: Dennis Francis
URL:
Whiteboard: target:6.3.0 target:6.2.4
Keywords: bibisected, regression
Depends on:
Blocks: Cell-Formula Drag-and-Drop
  Show dependency treegraph
 
Reported: 2019-03-25 18:56 UTC by Xisco Faulí
Modified: 2023-09-17 08:40 UTC (History)
5 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 Xisco Faulí 2019-03-25 18:56:35 UTC
This is a follow-up of bug 123714 that I found testing the bug.

Steps to reproduce:
1. Open attachment 149604 [details] from bug 123714
2. Select A2:A3 with the mouse
3. Drag & Drop it to Column B
4. Column E is updated -> bug 123714
5. Undo

-> Column E updates the formula from =$C3*B3*E$1 to =$C3*A3*E$1

Reproduced in

Version: 6.3.0.0.alpha0+
Build ID: 82463bdde75447d45e0cd6ed9ab579e0e51ea912
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: x11; 
Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US
Calc: threaded
Comment 2 Roman Kuznetsov 2019-03-26 23:21:28 UTC
repro in

Version: 6.3.0.0.alpha0+ (x64)
Build ID: 5a907fe76bc628629fddb5501727642468d38dae
CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2019-03-22_00:18:04
Locale: ru-RU (ru_RU); UI-Language: en-US
Calc: threaded
Comment 3 b. 2019-03-30 20:02:05 UTC Comment hidden (obsolete)
Comment 4 b. 2019-03-31 07:39:04 UTC
sorry, i was wrong, pls. ignore comment #3, 

in ver.: 2019-03-30_02:16:1 after drag and drop the formula in col. E is 'wrong' - deviating from previous state - , it is right after an undo of copy and paste, drag and drop behaves like a new move?, 

i wonder whether it's possible to do adequate changes in formulae and references with any combination of nested formulae and referenced ranges? and to keep that intuitive to users expectations, but that's another question. 

undo should restore the previous state.
Comment 5 Xisco Faulí 2019-04-01 09:09:20 UTC
@Dennis, I thought you might be interested in this issue...
Comment 6 b. 2019-04-05 07:57:52 UTC
boiling down: 

it's quite a special problem, xisco showed fine detective skills finding it, 

it depends on moving more than one cell, and on moving it with the mouse, 

it depends on moving inside the same row, 

it doesn't depend on complex formulae or '$'-absolute references, 

simpler sample: 

'2' in A1, A2
'=B1' in C1 
copy C1 to C2
drag and drop A1:A2 to B1:B2
undo by ctrl-z
formula in C1 and C2 is not 'restored', but 'adapted' to the 'new move'

moving single cells (e.g. A1 to B1) or 'diagonal moves' in similar longer columns (e.g. three lines as above and move A1:A2 to B2:B3) can be undone correctly, 

assumption: the code area around 'shared formulae' doesn't consist of one clean concept but of plenty patches just not covering this special action, 

assumption II: there might be more special cases not yet covered, 

proof that it's 'related' to 'SFP' (shared formulae problem): place empty lines between the rows and watch the bug being 'fixed', 

i may be totally wrong with the above, not with the following, 

evident truth: it's impossible to check the correctness of a complex program by testing and verifying all possible actions (you can't check unlimited possibilities in limited time), thus 'bug hunting' can only give hints towards weaknesses, validation of the code requires analytic check of the structures 

tests done with ver: 

Version: 6.3.0.0.alpha0+ (x64)
Build ID: 9956cf0692058414ef3efdb0e8058fbb0b39f6bc
CPU threads: 8; OS: Windows 6.1; UI render: default; VCL: win; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2019-04-04_02:20:31
Locale: de-DE (de_DE); UI-Language: en-US
Calc: 
(identical behaviour with 'threaded' on)

reg. 

b.
Comment 7 Commit Notification 2019-04-05 21:55:38 UTC
Dennis Francis committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/9079da7f62febaf4cef0b77320c31b4e8bb6b5a5%5E%21

tdf#124326 : ScUndoDragDrop : don't do update references...

It will be available in 6.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2019-04-06 14:06:42 UTC
Dennis Francis committed a patch related to this issue.
It has been pushed to "libreoffice-6-2":

https://git.libreoffice.org/core/+/559dadd0d6eaa61dab7e0bc2a510b87b7109be22%5E%21

tdf#124326 : ScUndoDragDrop : don't do update references...

It will be available in 6.2.4.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Xisco Faulí 2019-04-08 10:04:16 UTC
Verified in

Version: 6.3.0.0.alpha0+
Build ID: 31ac398cfa30694b18240d31df17a58d699b5bf6
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US
Calc: threaded

@Dennis Francis, thanks for fixing this issue!
Comment 10 Commit Notification 2019-04-27 20:20:44 UTC
Dennis Francis committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/22f4ad10ff9caef430ede01dc3acfe5fdf512d9b%5E%21

unit-test for tdf#124326

It will be available in 6.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.