Bug 39792 - Deletions or alterations of sheet-specific named ranges are not saved
Summary: Deletions or alterations of sheet-specific named ranges are not saved
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.4.1 release
Hardware: Other macOS (All)
: medium normal
Assignee: Markus Mohrhard
URL:
Whiteboard: target:3.5 target:3.4.3
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-03 02:24 UTC by James
Modified: 2011-12-23 14:16 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
sample file to demonstrate bug (101.08 KB, application/vnd.oasis.opendocument.spreadsheet)
2011-08-03 02:24 UTC, James
Details

Note You need to log in before you can comment on or make changes to this bug.
Description James 2011-08-03 02:24:11 UTC
Created attachment 49867 [details]
sample file to demonstrate bug

Go to the sheet Character Powers in the sample file (it should be the startup default). Go to Insert->Names->Define. Go to the names local to that sheet. You will see a named range called TestRange. Delete it, then press OK. Save the file. Reopen the file. Go to Insert->Names->Define. You will see that TestRange has magically reappeared!

A number of other things don't work either.

Changing the "Assigned to" field of TestRange fails to be saved. Reopening gets you the old definition.

Deleting TestRange, creating a new range called TestRange, and saving also fails. The old definition gets saved even though you deleted it and created a new variable in its place. In fact, you are unable to create any new names at all on that sheet. Oh, you can create them, and you will see them in the Define Names pane, but should you save, close, and reopen they will have disappeared.

You should have Automatically Update Links set to never, or say no if LO asks you to update.
Comment 1 Markus Mohrhard 2011-08-03 11:00:35 UTC
Let me have a look at it but might already be fixed in 3.4.2
Comment 2 Markus Mohrhard 2011-08-03 11:23:53 UTC
seems really be fixed in 3.4.2
Comment 3 James 2011-08-03 14:14:01 UTC
After upgrading to 3.4.2, I'm still seeing the problem. Don't forget the "close and reopen" step. If you just delete the range without closing the file everything looks ok. The Define Names panel appears to have done its job.
Comment 4 James 2011-08-03 14:59:31 UTC
I have reproduced a simple test case for this bug. To wit:

Open a New spreadsheet in calc.
Select Insert->Names->Define.
Select Sheet1 on the Scope popup.
Name your new range Test (or anything else you like). The default Assigned To is OK.
Click Add. Click OK.
Quit LO, clicking Save on the dialog box.
Reopen your newly saved spreadsheet.
Select Insert->Names->Define.
Select Sheet1 on the Scope popup.
Select the range you created above.
Click Delete. Click OK.
Quit LO, clicking Save on the dialog box.
Reopen the spreadsheet.
Select Insert->Names->Define.
Select Sheet1 on the Scope popup.
Observe that the range you deleted was not actually deleted.
Comment 5 James 2011-08-03 15:51:24 UTC
I have another test case.

Open a new blank spreadsheet.
Save and quit.
Reopen spreadsheet.
Select Insert->Names->Define.
Select Sheet1 on the Scope popup.
Create the new range Test (or any other name you like). The default Assigned To
is OK.
Click Add. Click OK.
Save and quit.
Reopen spreadsheet.
Select Insert->Names->Define.
Select Sheet1 on the Scope popup.
Observe that the range you created above is gone.
Comment 6 Jeffrey 2011-08-04 20:47:43 UTC
Reproduced on LibreOffice 3.4  340m1(Build:103) for OpenSuse Linux. Thanks for the document and clear steps. I followed the steps in the first one and the name/definition does not change upon re-opening.
Comment 7 Markus Mohrhard 2011-08-05 18:10:16 UTC
So after several hours of debugging I finally found the problem(feature?):

We copy the loaded sheet to the ouput stream if no change was made to the sheet. While this feature is a nice performance improvement I have to evaluate how I can adjust it so that it will consider changed range names as changes to the sheet.
I'll lower the severity a bit since we have now a workaround: change something in the specific sheet and save then.

For the next time I would be happy if you could create a small test document since your original document was a difficult to debug.
Comment 8 James 2011-08-05 22:42:45 UTC
(In reply to comment #7)
> For the next time I would be happy if you could create a small test document
> since your original document was a difficult to debug.

At the time, that was the only test case I had. Did you see the two super-simple test cases I described in comments #4 and #5?
Comment 9 m_a_riosv 2011-08-06 05:45:11 UTC
Have a try with Menu/Tools/Options/LibreOffice - Allow to save document even when the document is not modified.
Comment 10 Markus Mohrhard 2011-08-06 05:47:43 UTC
@mariosv: this is for a different feature, the only things that will help are changes to the sheet.
Comment 11 James 2011-08-06 13:51:15 UTC
I see the status has changed to "Resolved/Fixed". Will the fix be in 3.43?
Comment 12 Markus Mohrhard 2011-08-06 16:35:00 UTC
Yes, therefore I set in the whiteboard line target 3.4.3