Bug 105364 - Copy sheet, insert copy before first breaks inter-sheet cell links
Summary: Copy sheet, insert copy before first breaks inter-sheet cell links
Status: RESOLVED DUPLICATE of bug 85538
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-16 10:42 UTC by Frank van Wensveen
Modified: 2017-04-19 05:48 UTC (History)
2 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 Frank van Wensveen 2017-01-16 10:42:13 UTC
When copying a sheet and inserting the copy before the first sheet (tab) breaks the links between cells in different sheets.

Encountered on: LibreOffice 3.5.7.2 Build ID 350m1 (Build:2) running on Ubuntu Linux 12.04.5 LTS, kernel 3.2.0-119-generic-pae #162-Ubuntu SMP Tue Dec 6 14:37:52 UTC 2016 i686 i686 i386 GNU/Linux.

How to reproduce:

Set up a new spreadsheet as follows:
1. Create new spreadsheet
2. Click "Sheet3" tab
3. Enter a value in cell A1 (e.g. "123")
4. Click "Sheet1" tab
5. In cell A1, enter "=", then click "Sheet3" tab, click cell A1, hit ENTER.
6. Click "Sheet1" tab, click cell A1. Value in this cell will now be: "=Sheet3.A1".

Demonstrate correct behavior as follows:
7. Right-click "Sheet1" tab, select "Move/Copy Sheet", under "Action" select "Copy"; under "Location" select "Insert Before Sheet2", click "OK". This will create a new tab "Sheet 1_2" after the "Sheet1" tab.
8 Click "Sheet1_2", click cell A1. Value in this cell will now be: "=Sheet3.A1". This is correct behavior.

Demonstrate incorrect behavior (i.e. expose the bug) as follows:
9. Right-click sheet1_2, select "Delete Sheet", click "Yes"
10. Right-click "Sheet1" tab, select "Move/Copy Sheet", under "Action" select "Copy"; under "Location" select "Insert Before Sheet1", click "OK". This will create a new tab "Sheet 1_2" before the "Sheet1" tab.
8 Click "Sheet1_2", click cell A1. Value in this cell will now be: "=Sheet2.A1". THIS IS INCORRECT BEHAVIOR. The value should be "=Sheet3.A1" as was the case when the copy was inserted after the "Sheet1" tab.
Comment 1 Timur 2017-01-16 15:52:34 UTC
Could you please check Bug 86652, is this related or a duplicate?
Looks like the same issue with relative reference.
Comment 2 m_a_riosv 2017-01-17 00:01:06 UTC
(In reply to Frank van Wensveen from comment #0)
> ....
> Demonstrate incorrect behavior (i.e. expose the bug) as follows:
> 9. Right-click sheet1_2, select "Delete Sheet", click "Yes"
> 10. Right-click "Sheet1" tab, select "Move/Copy Sheet", under "Action"
> select "Copy"; under "Location" select "Insert Before Sheet1", click "OK".
> This will create a new tab "Sheet 1_2" before the "Sheet1" tab.
> 8 Click "Sheet1_2", click cell A1. Value in this cell will now be:
> "=Sheet2.A1". THIS IS INCORRECT BEHAVIOR. The value should be "=Sheet3.A1"
> as was the case when the copy was inserted after the "Sheet1" tab.

If you want it behaves in that way use absolute references for the sheet in the formula:
=$Sheet3.A1

It's the same behaviour like if you copy the formula from one sheet to another.
Comment 3 m_a_riosv 2017-01-17 00:04:04 UTC
BTW if you like such behavior you can push [Ctrl] while dragging the sheet tab.
Comment 4 Frank van Wensveen 2017-01-17 11:03:11 UTC
If this is the same behavior as when copying a formula from one cell to another, why is there a difference in behavior between copies inserted before or after the first tab? This seems inconsistent.
Comment 5 m_a_riosv 2017-01-17 12:31:26 UTC
For me the a bug is copying before previous sheets, relative reference fails by one sheet.

Add a new sheet4 at end, Copying from:
Sheet1 before Sheet2, formula should change to Sheet4.A1 but has Sheet3.A1
Sheet1 before Sheet3, formula should change to Sheet5.A1 but has Sheet4.A1

Please if you are agree, change the title accordingly.
Comment 6 Kevin Suo 2017-04-19 05:48:04 UTC

*** This bug has been marked as a duplicate of bug 85538 ***