Bug 118867 - EDITING Formula is not pasted correctly after Cut - Delete - Paste
Summary: EDITING Formula is not pasted correctly after Cut - Delete - Paste
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.0.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:6.2.0
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Paste
  Show dependency treegraph
 
Reported: 2018-07-21 08:10 UTC by Emil Tanev
Modified: 2019-08-15 12:36 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
file (9.69 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2018-07-21 08:10 UTC, Emil Tanev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Emil Tanev 2018-07-21 08:10:33 UTC
Created attachment 143666 [details]
file

Open the file
Select all
Cut
Delete
Paste (in cell A1)

Issue: Row 7, which used to have correct formulas, shows reference errors.
This does not happen with Cut/Paste only.

https://screencast-o-matic.com/watch/cFirjhFHQq


Version: 6.2.0.0.alpha0+ (x64)
Build ID: 715fcaff01ed048c52c69264a7a0fb773dd57b32
CPU threads: 1; OS: Windows 10.0; UI render: default; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-07-21_02:21:27
Locale: en-US (en_US); Calc: group threaded
Comment 1 m.a.riosv 2018-07-21 12:44:30 UTC
Not repro
Version: 6.2.0.0.alpha0+ (x64)
Build ID: 715fcaff01ed048c52c69264a7a0fb773dd57b32
CPU threads: 4; OS: Windows 10.0; UI render: default; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-07-21_02:21:27
Locale: es-ES (es_ES); Calc: CL
Comment 2 Roman Kuznetsov 2018-07-22 18:36:08 UTC
confirmed in

Version: 6.2.0.0.alpha0+ (x64)
Build ID: fa881095bc62c3646406c82a98d8503377288a54
CPU threads: 4; OS: Windows 10.0; UI render: GL; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-07-22_04:57:13
Locale: ru-RU (ru_RU); Calc: CL


problem with function SUBTOTAL

to m.a.riosv : look at screencast
Comment 3 Xisco Faulí 2018-07-23 17:49:57 UTC
Regression introduced by:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=a962f1465a8db9b6c4dfdfd8fef9141f07d7fd06

author	Eike Rathke <erack@redhat.com>	2017-06-27 15:00:55 +0200
committer	Eike Rathke <erack@redhat.com>	2017-06-27 15:04:22 +0200
commit	a962f1465a8db9b6c4dfdfd8fef9141f07d7fd06 (patch)
tree	747e4bd5f74039af7303664187b921b5234c43eb
parent	b06657fca57b02ffb267a168bc9323780aeafbef (diff)
Resolves: tdf#108788 update references for deletions at end of sheet
ie. when the last column or row is included in the deletion. This seems to have
never worked.

Bisected with: bibisect-linux64-6.0

Adding Cc: to Eike Rathke
Comment 4 Xisco Faulí 2018-07-23 17:52:53 UTC
> Adding Cc: to Eike Rathke

Forgot to add you as CC...
Comment 5 Eike Rathke 2018-07-24 17:17:40 UTC
The Delete operation shrinks the Table1 database range to A1:A7 for which after Paste a reference such as Table1[Jan] can not be found. This was different in 5.3.7 where the database range stayed on A1:N7.

Technically the current behaviour is even correct, because columns are deleted and empty columns are shifted in from the right, similar to any other selected column range deleted, but is unexpected for the ALL selection case.
Comment 6 Eike Rathke 2018-07-25 08:47:53 UTC
Or actually, it *is* expected because those columns are deleted. Same for any selected and deleted column range that spans the database range. In fact the database range should be entirely deleted, but that is not possible with the current implementation so one column remains. Also the AutoFilter buttons should be removed from the deleted columns.
Comment 7 Commit Notification 2018-07-25 21:10:43 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

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

Related: tdf#118867 refresh AutoFilter buttons when deleting cols/rows/cells

It will be available in 6.2.0.

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 Commit Notification 2018-07-26 09:42:29 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

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

Refresh AutoFilter buttons unconditionally, tdf#118867 related follow-up

It will be available in 6.2.0.

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 9 Xisco Faulí 2018-08-27 10:02:37 UTC
A polite ping to Eike Rathke:
Is this bug fixed? if so, could you please close it as RESOLVED FIXED ? Otherwise, Could you please explain what's missing?
Thanks
Comment 10 Eike Rathke 2018-08-27 16:51:43 UTC
I think the Delete step should entirely delete and remove the database range, instead of keeping one remaining column. That again will likely need additions to Undo/Redo to work as expected.

However, the original expectation that the cut formulas will work after a Paste after the Delete does not hold. The database range would be gone.

I assume though that the Delete was done by the OP because the AutoFilter buttons remained after the Cut. That's something that also needs to be addressed, the AutoFilter buttons are to be removed with the Cut; currently they are moved with the Paste, which is correct, but having them remain after the Cut is unexpected. Then again re-/moving is only correct if the *entire* database range was cut, but not if only a part of it, where the database range stays and thus the AutoFilter buttons as well. Quite twisted stuff..
Comment 11 Xisco Faulí 2018-11-26 16:46:30 UTC
Dear Eike Rathke,
This bug has been in ASSIGNED status for more than 3 months without any
activity. Resetting it to NEW.
Please assigned it back to yourself if you're still working on this.