Bug 103994 - cut and paste changes external reference
Summary: cut and paste changes external reference
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.2 all versions
Hardware: All All
: medium normal
Assignee: Eike Rathke
URL:
Whiteboard: target:5.3.0 target:5.2.4 target:7.4.0
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-17 19:28 UTC by Mark Dwyer
Modified: 2022-03-22 17:17 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
test case (4.36 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2016-11-17 19:33 UTC, Mark Dwyer
Details
test case (9.76 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-11-17 19:34 UTC, Mark Dwyer
Details
test case (7.80 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-11-17 19:35 UTC, Mark Dwyer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Dwyer 2016-11-17 19:28:00 UTC
Description:
If a calc spreadsheet references a cell in an xlsx source file, when that reference is cut and pasted to a new location in the same spreadsheet, the xlsx source cell it refers to changes.



Steps to Reproduce:
1. Create an xlsx file with some numbers in it and save (source.xlsx). 
2. Create a new spreadsheet and at A1, reference (=) one of the cells filled in the xlsx source, e.g., ='file:///home/user/Documents/source.xlsx'#$Sheet1.A1
3. Cut this cell and paste to a different location say, B1
4. The formula that is pasted is relative not absolute, e.g., 
='file:///home/user/Documents/source.xlsx'#$Sheet1.B1


Actual Results:  
The reference that has been cut and pasted has changed the source cell it links to. In the reproducible example, cutting a reference from A1 and pasting to B1 changes the formula from pointing to A1 in the source sheet to B1 in the source sheet. 

Expected Results:
Cut and Paste has always previously been absolute, not relative. Copy and paste is expected to be relative not cut and paste.


Reproducible: Always

User Profile Reset: No

Additional Info:
Using ubuntu 16.04 on an hp2540p. Don't think that matters though.


User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0
Comment 1 Mark Dwyer 2016-11-17 19:33:43 UTC
Created attachment 128827 [details]
test case

This is the xlsx source that shows the problem when linked to it.
Comment 2 Mark Dwyer 2016-11-17 19:34:33 UTC
Created attachment 128828 [details]
test case

This is the file linking to source.xlsx that illustrates the problem
Comment 3 Mark Dwyer 2016-11-17 19:35:13 UTC
Created attachment 128829 [details]
test case

This is an ods source that shows the same problem regardless of whether source is xlsx or ods.
Comment 4 Eike Rathke 2016-11-17 20:59:28 UTC
Confirmed.
Comment 5 Commit Notification 2016-11-17 21:15:03 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

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

Resolves: tdf#103994 AdjustReferenceOnMove: handle external references

It will be available in 5.3.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 6 Eike Rathke 2016-11-17 21:19:09 UTC
Pending review https://gerrit.libreoffice.org/30941 for 5-2
Comment 7 Commit Notification 2016-11-21 17:28:10 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5e397250c0ab2c092091c6dfe30d906a17fdca9e&h=libreoffice-5-2

Resolves: tdf#103994 AdjustReferenceOnMove: handle external references

It will be available in 5.2.4.

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 2022-03-22 17:17:13 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/a83dc2cebb60ec27a0d2606a9b7c196e581766fd

tdf#103994: sc_uicalc: Add unittest

It will be available in 7.4.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.