Bug 81330 - EDITING: references in formulas do not follow after move on an other sheet
Summary: EDITING: references in formulas do not follow after move on an other sheet
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.2.0.0.beta1
Hardware: All All
: high major
Assignee: Kohei Yoshida
URL:
Whiteboard: BSA target:4.4.0 target:4.3.1 target:...
Keywords: bibisected, regression
Depends on:
Blocks:
 
Reported: 2014-07-14 08:51 UTC by marc.polizzi
Modified: 2020-02-02 23:10 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file to show the effect. (57.73 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-07-14 15:16 UTC, Albrecht Müller
Details

Note You need to log in before you can comment on or make changes to this bug.
Description marc.polizzi 2014-07-14 08:51:04 UTC
Problem description: 

Steps to reproduce:
1. Sheet1 A1=12 A2=A1*2
2. Move cell A2 to Sheet2 
3. Edit new formula : A1*2 the reference don't follow 

Current behavior:
on sheet2 =A1*2

Expected behavior:
on sheet =sheet1.A1*2
              

Operating System: Windows 7
Version: 4.2.5.2 release
Comment 1 ign_christian 2014-07-14 09:51:50 UTC
Reproduced with LO 4.2.0.0.beta1, 4.2.4.2, 4.2.6.1, 4.3.0.2 on Ubuntu 12.04 x86. 

Not reproduced with LO 4.1.6.2

Same result with both cut-paste and move/drag.

Perhaps it's been reported before, but I haven't found yet.
Comment 2 ign_christian 2014-07-14 09:55:06 UTC
@Marc, next time please don't mark your own bug report as NEW. Others will mark that if same behavior confirmed.
Comment 3 Albrecht Müller 2014-07-14 15:16:02 UTC
Created attachment 102780 [details]
Example file to show the effect.
Comment 4 Albrecht Müller 2014-07-14 15:23:03 UTC
Comment on attachment 102780 [details]
Example file to show the effect.

The attachment should help to confirm bug in the original bug report and shows that the problem of not following references occurs also if names are involved.

How to reproduce:
Copy the cells A3:B3 of Sheet2 and of Sheet3 somewhere into Sheet4.

Current behaviour:
The cells in Sheet 4 display, assuming the cells in Sheet2 have been copied first:
Value in Sheet2   2
Value in Sheet3   2

Expected behaviour:
The cells in Sheet 4 display:
Value in Sheet2   2
Value in Sheet3   3

The problem is caused by the fact that cells B3 in Sheet2 and Sheet3 both contain “=value”. The name “value” is local to each sheet and refers to cell B2 in the same sheet. The first copy creates a new name “value” local to Sheet4, the second copy does not recognize the name clash. Thus the content of the second copy refers to the wrong cell.

During creation of this example I found two other errors:
a) I first created the content “=value” in cell B3 of Sheet2 and created the name later. Cell B3 did not update, i.e. the error message remained until I re-entered the content of cell B3.

b) Undo does not work properly: When I copied the cells to Sheet4, a name “value” restricted to Sheet4 was created. I used Undo to cancel the effect of the copy, but this name remained.
Comment 5 Joel Madero 2014-07-16 02:59:14 UTC
 ba096f438393091574da98fe7b8e6b05182a8971 is the first bad commit
commit ba096f438393091574da98fe7b8e6b05182a8971
Author: Bjoern Michaelsen <bjoern.michaelsen@canonical.com>
Date:   Thu Oct 17 20:00:21 2013 +0000

    source-hash-8499e78ca03c792f4fa2650e02b519094ba0baa8
    
    commit 8499e78ca03c792f4fa2650e02b519094ba0baa8
    Author:     Caolán McNamara <caolanm@redhat.com>
    AuthorDate: Thu Jul 25 16:01:13 2013 +0100
    Commit:     Caolán McNamara <caolanm@redhat.com>
    CommitDate: Thu Jul 25 16:08:01 2013 +0100
    
        Related: fdo#61544 convert language page from box to grid
    
        grid compress better than boxes if there isn't enough available space
    
        Change-Id: I35b433b89a29159a33fc9edb646e46b371747a57

:100644 100644 28f5d06d73a1be6ffa14981fa5c85369334b42f3 69df816431adccb1d94d7239031fa72b51b69fd9 M	ccache.log
:100644 100644 e90dd416081e52bf1f529e5cc252b740762fb67f fb3eed5f2df90e38291b7693863d22a51ae5f909 M	commitmsg
:100644 100644 f3412ea896c81e0e5e7c7c5b20da51801f5732d1 b37aff13469762597fe8e71b9eec6543077c6320 M	dev-install.log
:100644 100644 20c900e22a8115c31e67f895acbe3ec11c432314 a6d96513f1e560f38ad6b20e13ae9c5ddb619132 M	make.log
:040000 040000 956ae0b2d085e2de7f912e234fe22cb51b2e3f29 14c94892e549a813ae539489d88273f18ad79631 M	opt

# bad: [423a84c4f7068853974887d98442bc2a2d0cc91b] source-hash-c15927f20d4727c3b8de68497b6949e72f9e6e9e
# good: [65fd30f5cb4cdd37995a33420ed8273c0a29bf00] source-hash-d6cde02dbce8c28c6af836e2dc1120f8a6ef9932
git bisect start 'latest' 'oldest'
# good: [e02439a3d6297a1f5334fa558ddec5ef4212c574] source-hash-6b8393474974d2af7a2cb3c47b3d5c081b550bdb
git bisect good e02439a3d6297a1f5334fa558ddec5ef4212c574
# bad: [4850941efe43ae800be5c76e1102ab80ac2c085d] source-hash-980a6e552502f02f12c15bfb1c9f8e6269499f4b
git bisect bad 4850941efe43ae800be5c76e1102ab80ac2c085d
# skip: [a043626b542eb8314218d7439534dce2fc325304] source-hash-9379a922c07df3cdb7d567cc88dfaaa39ead3681
git bisect skip a043626b542eb8314218d7439534dce2fc325304
# skip: [aba65c3e4c0df07e4909aeefb758cdb688242bf6] source-hash-827524abfb4b577d08276fde40929a9adfb7ff1a
git bisect skip aba65c3e4c0df07e4909aeefb758cdb688242bf6
# bad: [c81a8a0dcfc1ed095a80e4485c89dd0fcaf73f31] source-hash-c69ed33628ec0b7abf6296539cf280d6c4265930
git bisect bad c81a8a0dcfc1ed095a80e4485c89dd0fcaf73f31
# bad: [1d4980621741d3050a5fe61b247c157d769988f2] source-hash-89d01a7d8028ddb765e02c116d202a2435894217
git bisect bad 1d4980621741d3050a5fe61b247c157d769988f2
# bad: [ba096f438393091574da98fe7b8e6b05182a8971] source-hash-8499e78ca03c792f4fa2650e02b519094ba0baa8
git bisect bad ba096f438393091574da98fe7b8e6b05182a8971
# good: [9daa289e178460daaafa4b3911031df5b8736218] source-hash-704292996a3731a61339b1a4a5c90c9403aa095f
git bisect good 9daa289e178460daaafa4b3911031df5b8736218
# good: [34eab3946c46bb7273ba4ca395db9c4421dd232f] source-hash-e962805b31074d6b6a2ed0db6452769448337553
git bisect good 34eab3946c46bb7273ba4ca395db9c4421dd232f
# good: [a8577b9049e085140768f97f7d4ff555a8a447cb] source-hash-98ded3e42011b060368899018c07cbd32e7993f1
git bisect good a8577b9049e085140768f97f7d4ff555a8a447cb
# good: [da4ad98ef394c644bb0aa80161ff599330862e7c] source-hash-570fe620e9d573cfc9fc260e6518563c6a6c1a3c
git bisect good da4ad98ef394c644bb0aa80161ff599330862e7c
# good: [2d9baecf3ce2ea1ec8bea3e842eed595061eeef6] source-hash-ff51a2b64571a8d72ff4d8a8181d17cf98c42e69
git bisect good 2d9baecf3ce2ea1ec8bea3e842eed595061eeef6
# first bad commit: [ba096f438393091574da98fe7b8e6b05182a8971] source-hash-8499e78ca03c792f4fa2650e02b519094ba0baa8
Comment 6 Kohei Yoshida 2014-07-29 23:52:52 UTC
Comments 3 and 4 should be a separate bug report.  We should focus on the original bug report from marc.polizzi@ac-versailles.fr here.  Thanks.
Comment 7 Kohei Yoshida 2014-07-30 00:55:33 UTC
(In reply to comment #6)
> Comments 3 and 4 should be a separate bug report.  We should focus on the
> original bug report from marc.polizzi@ac-versailles.fr here.  Thanks.

Ah, nevermind.  If the additional comments supplement the original other than adding a new use case, no need to,
Comment 8 Kohei Yoshida 2014-07-30 00:58:03 UTC
BTW, this is just a display issue, since changing the value of A1 on the 1st sheet after the move correctly updates the formula cell in the 2nd.  We just need to display the sheet name in the moved formula cell.
Comment 9 Kohei Yoshida 2014-07-30 00:59:09 UTC
I'll take this.
Comment 10 Commit Notification 2014-07-30 02:37:33 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

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

fdo#81330: Write test for this.



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 11 Commit Notification 2014-07-30 02:37:49 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "master":

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

fdo#81330: When moving to a different sheet, set 3D flag on.



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 12 Kohei Yoshida 2014-07-30 02:38:39 UTC
Fixed on master, and backports to 4.2 and 4.3 on the way.
Comment 13 Commit Notification 2014-07-30 08:15:02 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "libreoffice-4-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a1f8f6055590330ed36fdae9d9a520d053b80923&h=libreoffice-4-3

fdo#81330: When moving to a different sheet, set 3D flag on.


It will be available in LibreOffice 4.3.1.

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 14 Commit Notification 2014-07-30 08:16:58 UTC
Kohei Yoshida committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

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

fdo#81330: When moving to a different sheet, set 3D flag on.


It will be available in LibreOffice 4.2.7.

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 15 marc.polizzi 2014-08-01 08:48:00 UTC
(In reply to comment #14)
> Kohei Yoshida committed a patch related to this issue.
> It has been pushed to "libreoffice-4-2":
> 
> http://cgit.freedesktop.org/libreoffice/core/commit/
> ?id=ca8a6d4ff366f0ad7c2da6b76f76f624c593592f&h=libreoffice-4-2
> 
> fdo#81330: When moving to a different sheet, set 3D flag on.
> 
> 
> It will be available in LibreOffice 4.2.7.
> 
> 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.

Hi,

Excuse me, but the bug is not resolved.
I juste downmload the last version 4.3 and the bug is always present.
I have not find th 4.2.7. 
So for me, the bug is not solved ?

Cordialy 
Marc
Comment 16 marc.polizzi 2014-08-01 08:49:31 UTC
The bug is not solved in 4.3
Comment 17 ign_christian 2014-08-01 09:01:20 UTC
(In reply to comment #16)
> The bug is not solved in 4.3
If you try 4.3.0.4, of course it's not fixed. Just see Whiteboard to see first release of the fix.

Verified fix in daily build with:

Version: 4.3.1.0.0+
Build ID: ce65a47f6028879337e9e133053cc397b1b582bd
TinderBox: Linux-rpm_deb-x86@45-TDF, Branch:libreoffice-4-3, Time: 2014-07-30_10:54:10
Comment 18 marc.polizzi 2014-08-01 10:20:07 UTC
(In reply to comment #17)
> (In reply to comment #16)
> > The bug is not solved in 4.3
> If you try 4.3.0.4, of course it's not fixed. Just see Whiteboard to see
> first release of the fix.
> 
> Verified fix in daily build with:
> 
> Version: 4.3.1.0.0+
> Build ID: ce65a47f6028879337e9e133053cc397b1b582bd
> TinderBox: Linux-rpm_deb-x86@45-TDF, Branch:libreoffice-4-3, Time:
> 2014-07-30_10:54:10

OK and where can I dowload this new version 4.3.1 ??
Comment 19 ign_christian 2014-08-01 10:34:01 UTC
(In reply to comment #13)
> 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 20 marc.polizzi 2014-08-01 16:36:57 UTC
(In reply to comment #19)
> (In reply to comment #13)
> > 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.

OK, thank you.
I have download the 4.3.1 and it's work :o)
Comment 21 marc.polizzi 2014-08-28 16:05:30 UTC
On the new version 4.3.1.1 the bug is not resolved.

It's solved at 50%.

Sheet1.A1=12
Sheet1.A2=A1*2
Sheet1.A3=A2*3


Move Cell A2 on Sheet2.A1
The formula follow ....
but come back to sheet1.A3
the formula must be
=Sheet2.A2*3
but it is
=A1*3
!!!!

The formula is not update 
ans some time the result is good with a bad formula...

HORRIBLE !
Comment 22 ign_christian 2014-08-28 16:39:52 UTC
I can confirm Marc's observation with 4.3.1.2 -> reference in source worksheet not updated.

Lets wait for Kohei if we should file new bug report for this.
Comment 23 ign_christian 2014-08-28 16:42:40 UTC
(In reply to comment #22)
> ... reference in source
> worksheet not updated.
Sorry..I meant updated incorrectly
Comment 24 Joel Madero 2014-08-28 16:44:42 UTC
Just a suggestion for future bug reporting: tagging unnecessary lines like "HORRIBLE" to the bug just dissuades our volunteers from contributing as it appears like a personal attack on their work while adding absolutely nothing to the quality of the bug report. Just my two cents here - no need to respond in the bug report as we don't like to clutter it with extraneous comments
Comment 25 Eike Rathke 2014-08-28 17:13:16 UTC
@Marc:
Your reopening is a HORRIBLE duplicate of bug 82936 instead.
Comment 26 ign_christian 2014-08-29 03:04:33 UTC
Eike, it seems not resolved with Bug 82936. I filed new report for the case: Bug 83217
Comment 27 marc.polizzi 2014-08-29 08:40:32 UTC
On the Wiheboard 4.3.1 is wrong, perhaps 4.3.2 ?

I hope 4.3.2 really works.
Comment 28 ign_christian 2014-08-29 09:38:11 UTC
Marc, please reread description of this bug (that was reported by yourself). It is different with the case in comment 21 (Bug 83217).

This bug (Bug 81330) -> reference cell in target worksheet not updated (fixed in 4.3.1)
Comment 21 (Bug 83217) -> refernce cell in source worksheet incorrectly updated
Comment 29 Robinson Tryon (qubit) 2015-12-17 08:26:42 UTC
Migrating Whiteboard tags to Keywords: (bibisected)
[NinjaEdit]
Comment 30 b. 2020-01-27 02:59:52 UTC
the attached sheet and comment #4 from Albrecht Müller point to some faults not yet covered? 

in the attachement the move of sheet2.B1 to sheet3.B1 destroys either the ‚name-label‘ ‚value‘ for cell sheet3.B2, or the referencing it in cell sheet3.B3, with ver. 7.0.0.0.alpha1+ it shows #NAME? thus reopening the bug, 
retyping ‚=value‘ in sheet3.B3 helps out, hard recalc doesn't 

also reopening the bug because one of the steps described by Albrecht Müller creates a name reference ‚value‘ to sheet4.B2, that is – sometimes – not shown in the name reference select box below the font type box, but on ‚editing named ranges‘ by ctrl-F3, 
if you undo the steps described below (first copy, then move with overpasting from sheet 2 and sheet3 to sheet4) with ctrl-Z the ‚value‘ reference to sheet4.B2 is applied to sheet3.B3 as ‚sheet4.value‘ in one step, 
and the reference on sheet4 is never ‚undone‘ in the undo steps, but on a second try (copy, then move with overpasting, then undo) the behaviour is different and the reference on sheet4 disappears … unpredictable behaviour ... 

additional amendments: 

c#3 and c#4: @Albrecht: in the description given into the attachement you suggest copying of B2, imho you intended to refer to B1, you speak about ‚copying‘ of B2, imho you intended to say ‚move‘ of B1?
following you speak about ‚copying‘ sheet2.A2:A3 and sheet3.A3:B3 to sheet4, imho you intended to move them? 

copying produces one cell with ‚value in sheetx‘, and besides one cell with err:522, what is correct as sheet4 has no name reference ‚value‘, 
moving produces ‚#NAME?‘ besides the call ‚value in sheetx‘, one might argue if thats correct – as the cell where the label points to is removed, or a bug – as the label should have followed the move … don‘t ask me, 

problem from comment #21 seems gone, 

if above problems are covered elsewhere feel free to ad a comment pointing there and reclose this bug,
Comment 31 Eike Rathke 2020-01-28 18:15:59 UTC
Please submit a new bug instead of reopening a years old bug. Thanks.
Comment 32 b. 2020-02-02 23:10:15 UTC
@Eike: 

> Please submit a new bug instead of reopening a years old bug. Thanks.

did so, pls. see 

https://bugs.documentfoundation.org/show_bug.cgi?id=130370 

and 

https://bugs.documentfoundation.org/show_bug.cgi?id=130371