Bug 123724 - EDITING: sheet local named ranges become corrupt during deletion of sheet
Summary: EDITING: sheet local named ranges become corrupt during deletion of sheet
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.4.7.2 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Cell-Name
  Show dependency treegraph
 
Reported: 2019-02-26 17:32 UTC by tldr+acc
Modified: 2021-06-10 12:21 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Example Spreadsheet (8.69 KB, application/vnd.oasis.opendocument.spreadsheet)
2019-02-26 17:33 UTC, tldr+acc
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tldr+acc 2019-02-26 17:32:40 UTC
Description:
Sheet contains sheet-local references to named ranges. If that sheet is copied and placed at the very beginning *and* deleted again, the references in original sheet become corrupt.

The same happens if the copied sheet is placed at the end and the original sheet is deleted. In that case the references in copied sheet become corrupt.

I will upload a minimal example spreadsheet.

The bug seems to be related to #87153 (already fixed). At least I am able to reproduce the very same issue with the example contained in that bug report.

Let me know if you need more information.

Steps to Reproduce:
1. Copy current sheet and insert it at the very beginning.
2. Delete the newly created sheet again.
3. The yellow cell (containing a sheet-local named range) will become corrupt.

Actual Results:
Reference to named range become corrupt.

Expected Results:
Reference is still valid.


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 tldr+acc 2019-02-26 17:33:41 UTC
Created attachment 149605 [details]
Example Spreadsheet
Comment 2 Oliver Brinzing 2019-02-26 17:48:09 UTC
reproducible with:

Version: 6.1.5.2 (x64)
Build ID: 90f8dcf33c87b3705e78202e3df5142b201bd805
CPU threads: 4; OS: Windows 10.0; UI render: default; 
Locale: de-DE (de_DE); Calc: 

and

Version: 6.3.0.0.alpha0+ (x64)
Build ID: ca8eef6be3e45b934879780e847d6ef4faba857a
CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; 
Locale: de-DE (de_DE); UI-Language: en-US
Calc: threaded


formula in cell "Sheet1.G3" changes 
from: =factor
to:   =#NAME?
Comment 3 Oliver Brinzing 2019-02-26 17:51:56 UTC
already reproducible with

Version: 5.4.7.2 (x64)
Build-ID: c838ef25c16710f8838b1faec480ebba495259d0
CPU-Threads: 4; BS: Windows 6.19; UI-Render: Standard; 
Gebietsschema: de-DE (de_DE); Calc: single
Comment 4 russell 2019-04-05 21:31:52 UTC
Ran into this also at 6.2.2.2 with a larger spreadsheet, but narrowed it down to:

Steps to recreate:

1. Open Calc and create a new spreadsheet (Sheet1). Update 3 cells:

    A1: "Label"

    B1: "text data numbers"
        
        Name B1 via the Named Box to "TestData". 
        Select Manage Names and change scope from Global to Sheet1
        
    A2: =TestData

2. Right click Sheet1 > Insert Sheet

3. Right click Sheet2 > Delete Sheet > Yes

Sheet1 Before:
Label text data numbers
text data numbers

Sheet1 After:
Label text data numbers
#NAME? 

I was able to repeat this. In addition, if I delete Sheet1 (rather than Sheet2, as above), the named cell becomes orphaned.

1 & 2. Same as above.

3. Delete Sheet1 rather than Sheet2

   The named cell "TestData" is visible in the dropdown. 
   If you select it in the Name Box, an informational dialog pops-up, 
   "You must enter a valid reference or type a valid name for the 
   selected range.". If you click Managed Names, there are no names in the list. 
   The name appears to be orphaned.
Comment 5 QA Administrators 2021-04-05 03:53:22 UTC Comment hidden (obsolete)
Comment 6 tldr+acc 2021-04-07 19:22:27 UTC
I tested both instructions to reproduce, mine and that from russel. The issue does not exist anymore.


Version: 7.0.4.2
Build ID: 00(Build:2)
CPU threads: 4; OS: Linux 5.10; UI render: default; VCL: x11
Locale: de-DE (en_US.utf8); UI: en-US
Debian package version: 1:7.0.4-3
Calc: threaded
Comment 7 NISZ LibreOffice Team 2021-06-10 12:21:11 UTC
Verified in:
Version: 7.2.0.0.alpha1+ (x64) / LibreOffice Community
Build ID: aa9cb8e14749e7fb7a83b55a2bb095501f731a18
CPU threads: 4; OS: Windows 10.0 Build 17134; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Calc: threaded