Bug Hunting Session
Bug 86652 - links to cells in different sheet of the same calc file break when copying the sheet with links inside the same calc file
Summary: links to cells in different sheet of the same calc file break when copying th...
Status: RESOLVED DUPLICATE of bug 85538
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-24 05:38 UTC by bugquestcontri
Modified: 2017-04-19 02:29 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
file used to make tests as described (12.77 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-11-24 06:34 UTC, bugquestcontri
Details
Test file using 4.2.6 portable (15.63 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-11-25 01:30 UTC, bugquestcontri
Details
Test file using 4.3.4 portable (11.96 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-11-25 01:33 UTC, bugquestcontri
Details
Better file to make test (12.50 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-01-12 15:26 UTC, Timur
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bugquestcontri 2014-11-24 05:38:23 UTC

    
Comment 1 bugquestcontri 2014-11-24 06:34:53 UTC
Created attachment 109924 [details]
file used to make tests as described
Comment 2 bugquestcontri 2014-11-24 06:36:08 UTC
different to bug85538 the bug occurs in the same sheet and continuous copies of show changing behavior.
Comment 3 bugquestcontri 2014-11-24 06:40:23 UTC
Sorry for my mistake - the bug description is here

Procedure to reproduce:

- create a new Calc file
- enter a few numbers somewhere in sheet 1
- go to sheet 2
- link a few cells the cells with content in sheet 1 (the cells in sheet 2 show the content of the linked cells as expected)
- right click tab of sheet 2
- click Move/copy sheet
- select Copy and move to end (others not tested)
- click OK
now the first copy of sheet2 = sheet2-2 is created
links are broken, cells show  #REF

- select sheet2-2
right click tab of sheet 2-2
- click Move/copy sheet
- select Copy and move to end (others not tested)
- click OK

now the first copy of the copy of sheet2 = sheet2-2-2 is created
links are correct to the cells of sheet1 and the correct values are shown

- select sheet2-2-2
right click tab of sheet 2-2-2
- click Move/copy sheet
- select Copy and move to end (others not tested)
- click OK

now the copy of the copy of sheet2 = sheet 2-2-2-2 is created
links now to sheet2 but values are shifted 1 row down
(look at the links and the displayed value)


- select sheet2-2-2-2
right click tab of sheet 2-2-2-2
- click Move/copy sheet
- select Copy and move to end (others not tested)
- click OK

now the copy of the copy of the copy of sheet2 = sheet2-2-2-2-2 is created
links point to sheet2-2 and there is a vertical off-set
displayed values are #REF except for top cell which shows 0 


step back
- select sheet2-2
right click tab of sheet 2-2
- click Move/copy sheet
- select Copy and move to end (others not tested)
- click OK

now the 2nd copy of sheet2 = sheet2-3 is created
links point to sheet2-2-2 and have a vertical offset

here I stopped to make further tests with further copies

I think this bug should be removed with a very high priority.

In previous versions (4.0. 4.1. 4.2 all >- x.y.4) copying a sheet inside the same Calc file did not create any link related problems.
Comment 4 bugquestcontri 2014-11-24 06:41:18 UTC
(In reply to bugquestcontri from comment #0)
> 

see comment 3 for description - sorry for my mistake!
Comment 5 Tim Lloyd 2014-11-24 22:53:42 UTC
Reproduced on Windows XP LO 4.2.0.4

Fedora 21
Version: 4.4.0.0.beta1
Build ID: 9af3d21234aa89dac653c0bd76648188cdeb683e
Locale: en_AU


- populate A1, B2, C3 in sheet 1
- In sheet 2 link to sheet1.A1 and sheet1.C3
- As described copy sheet2 to end
- The new sheet has links to sheet2.A1 & sheet2.C3

Changed hardware to ALL
Changed priority to medium as it ain't crashing anything
I changed the version to 4.2.0.4 as instructed by bugzilla (ie. earliest version). Please note this was also tested with the "latest and greatest"
Comment 6 bugquestcontri 2014-11-25 01:30:55 UTC
Created attachment 109970 [details]
Test file using 4.2.6 portable

I repeated procedure as describe in first bug report. However in 4.2.6 portable the links do not break.

Detail information on build in attachment sheet 1
Comment 7 bugquestcontri 2014-11-25 01:33:16 UTC
Created attachment 109971 [details]
Test file using 4.3.4 portable

In portable version 4.3.4 links do not break. Procedure the same as described in first bug report. 

Detail built number inside test file on sheet 1

All my test with portable version are made as well on XP/SP3
Comment 8 m.a.riosv 2015-05-10 23:36:24 UTC
*** Bug 91211 has been marked as a duplicate of this bug. ***
Comment 9 Joel Madero 2015-05-11 17:54:10 UTC
This bug is really overcomplicated. I don't see it ever working correctly.

I just tested version 3.3 - I see the same behavior that I saw in 4.4.2.2 and LibreOffice 5.

There is no confirmation that this is a regression - removing whiteboard status.


@bugquestcontri: Here are some notes:

1. I never see #REF after the first bug reported;

2. I never see the correct behavior after step 2 (you say that it looks fine in 2_2_2 but for me, when I follow your steps, it's already off by one)
Comment 10 m.a.riosv 2016-01-11 23:03:19 UTC
*** Bug 97044 has been marked as a duplicate of this bug. ***
Comment 11 Timur 2016-01-12 15:26:59 UTC
Created attachment 121879 [details]
Better file to make test

Well, in Comment 3 I expected that you got to the Moon in the end :)
Bug description is not correct.
Test file for portable is different from the original test file. 
Conclusions in Comment 6 and Comment 7 that links do not break are WRONG. Links are always changed in the same way. 

Let me copy from Bug 97044:
"Copying sheet inside the same document causes #REF! error if cells have reference to other sheets" but only "if that sheet is copied before source sheet and if reference is RELATIVE".
If the reference is absolute, =$Sheet1.$A$4, it's ok, and if the new sheet is copied after the source sheet, it's also ok.
REF here stands for something as =ThisNewSheetThatDidn'tExist.A4

So, for me as an average user this all makes sense, and I'm not sure it's a bug at all. It's all logical with relative links. 
Question is: what's your expected result?
Comment 12 Renovatio 2016-01-20 15:12:23 UTC
For me this is bug.

The copy should not change the 'sheet reference' inside the formula independently if it's an absolute or an relative reference. 

Despite being relative, before or after, at the end of the copy it continues to exist and to be valid.

See other spreadsheets, the 'sheet reference' is never destroyed.
Comment 13 Kevin Suo 2017-04-19 02:29:25 UTC

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