Bug 91078 - Deleting a sheet which is not referenced by other sheets, destroys the formulas in those other sheets.
Summary: Deleting a sheet which is not referenced by other sheets, destroys the formu...
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
: highest major
Assignee: Eike Rathke
URL:
Whiteboard: target:5.0.0 target:4.4.4
Keywords: bibisected, regression
Depends on:
Blocks: mab4.3
  Show dependency treegraph
 
Reported: 2015-05-04 14:46 UTC by Nikos
Modified: 2015-12-17 09:03 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
For testing (8.49 KB, application/vnd.oasis.opendocument.spreadsheet)
2015-05-04 14:46 UTC, Nikos
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nikos 2015-05-04 14:46:48 UTC
Created attachment 115309 [details]
For testing

Sorry for the unclear title, the steps to reproduce will be clear:
1. open attached document (it contains a range named testrange on sheet Table cells A1:B3, on sheet "Source" it contains a reference to this data range and on sheet "Renamed" a reference to "Source")
2. Delete sheet "Fisrt_2"

Expected result:
Formulas on sheet "Source" remain unchanged as they contain no direct or indirect reference to the deleted sheet.

Actual result:
Formulas on sheet "Source" are destroyed.
Comment 1 Nikos 2015-05-04 14:47:52 UTC
This is a regression to 4.1.6 (at least)
Comment 2 Nikos 2015-05-04 15:06:55 UTC
Alternative way to reproduce:
right click "Renamed" --> Move/Copy Sheet --> Copy before "First_2"
expected result:
No change in sheet "Renamed".
actual result:
Formulas on Sheet "Renamed" return N/A.
Comment 3 m_a_riosv 2015-05-04 21:13:28 UTC
Hi Nikos, thanks for reporting.

First ( can't see in your file the testrange name defined.

After define the range name, issue is reproducible after deleting "First_2" sheet VLOOKUP calculation is in error no matter using F9 or Ctrl+Shift+F9 to recalculate.

Saving and reopening the file, formulas looks ok.
Editing with F2 a formula adding a space plus intro, shows it correct again.
Comment 4 Nikos 2015-05-05 05:53:49 UTC
Please note, that I was not talking about a named range but about a data range (as in Data --> Define Range and not in Insert --> Names --> Define).
Comment 5 m_a_riosv 2015-05-05 08:13:22 UTC
Ok, but seems there is the same issue.

Saving and reopening, formulas result it's fine again.
And editing with F2 also.
Comment 6 Nikos 2015-05-05 10:38:47 UTC
Yes, I checked that too. Thank you (though unfortunately not a real workaround for me as we use these copying operations in a script)
Comment 7 m_a_riosv 2015-05-05 14:27:02 UTC
Reproducible with:
Versión: 4.2.0.0.beta1 Build Id: f4ca7b35f580827ad2c69ea6d29f7c9b48ebbac7
Version: 5.0.0.0.alpha1+ (x64) Build ID: d2ab54bb0d07d285c91a8ac17f53559e438d042a
         TinderBox: Win-x86_64@42, Branch:master, Time: 2015-05-03_01:38:48

Last version working:
Versión: 4.1.6.2 Build ID: 40ff705089295be5be0aae9b15123f687c05b0a

Change version to the first with the issue.
Comment 8 m_a_riosv 2015-05-05 14:33:08 UTC
Maybe some relation with https://bugs.documentfoundation.org/show_bug.cgi?id=90001,
but I'm not sure it is the same case, because in that the erased sheet is referenced.
Comment 9 Joel Madero 2015-05-06 06:09:55 UTC
Version is oldest confirmed version. Updating per comment 1

setting to
Major - loss of data
Highest - regression + likely to impact a lot of users.

Adding to 4.3mab

 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
# skip: [aba65c3e4c0df07e4909aeefb758cdb688242bf6] source-hash-827524abfb4b577d08276fde40929a9adfb7ff1a
git bisect skip aba65c3e4c0df07e4909aeefb758cdb688242bf6
# bad: [c81a8a0dcfc1ed095a80e4485c89dd0fcaf73f31] source-hash-c69ed33628ec0b7abf6296539cf280d6c4265930
git bisect bad c81a8a0dcfc1ed095a80e4485c89dd0fcaf73f31
# 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 10 Nikos 2015-05-06 12:32:51 UTC
I am sorry, I think my first comment was confusing.
Version 4.1.6 worked for me and I had not checked the 4.2 and 4.3 series as there were other bugs which prevented me from updating.
I reverted version to 4.2. as the change by Joel Madero was based on my comment.
Comment 11 Commit Notification 2015-05-06 15:30:33 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

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

Resolves: tdf#91078 check also DBData modified, not only named expressions

It will be available in 5.0.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 12 Joel Madero 2015-05-06 15:31:34 UTC
Eike - can we get this into 4.4?
Comment 13 Eike Rathke 2015-05-06 16:07:36 UTC
Pending review for 4-4 https://gerrit.libreoffice.org/15654
Comment 14 Commit Notification 2015-05-06 17:18:51 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

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

now also ocTableRef is DBData, tdf#91078 related

It will be available in 5.0.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 15 Commit Notification 2015-05-07 13:57:34 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-4-4":

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

Resolves: tdf#91078 check also DBData modified, not only named expressions

It will be available in 4.4.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 16 Nikos 2015-05-07 14:34:53 UTC
Thanks for the quick fix, will check in a few days in the daily builds.
Comment 17 Zangune 2015-05-22 14:59:38 UTC
Nikos, if you downloaded the LibreOffice daily build, tested it and you can confirm that this bug is fixed in the daily build then you can change the status from RESOLVED to VERIFIED in Bugzilla, this would be helpful.
Read here https://bugs.documentfoundation.org/show_bug.cgi?id=50100
Comment 18 Robinson Tryon (qubit) 2015-12-17 09:03:35 UTC
Migrating Whiteboard tags to Keywords: (bibisected)
[NinjaEdit]