Bug 72240 - Unremovable cell protection created out of nothing
Summary: Unremovable cell protection created out of nothing
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.1.3.2 release
Hardware: All All
: medium normal
Assignee: Markus Mohrhard
URL:
Whiteboard: target:5.2.0
Keywords: preBibisect, regression
Depends on:
Blocks:
 
Reported: 2013-12-02 18:33 UTC by Marc Schipperheyn
Modified: 2016-10-25 19:08 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
A stripped down version of the file with macro (38.27 KB, application/vnd.oasis.opendocument.spreadsheet)
2013-12-04 12:15 UTC, Marc Schipperheyn
Details
Backtrace of JS macro crash (10.48 KB, text/plain)
2015-05-01 15:55 UTC, Buovjaga
Details
Minimal reproducer (17.55 KB, application/vnd.oasis.opendocument.spreadsheet)
2015-05-06 03:56 UTC, Matthew Francis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Schipperheyn 2013-12-02 18:33:50 UTC
This bug has been following me around for years and years already. In a Calc sheet some cell will somehow become "Protected" and whenever you try to edit them you get a message "Protected cells cannot be modified". In the past, I got this message and it would still edit the cells. A nuisance but workable. But now, it actually protects the cells. Just for clarity, I never protect documents or sheets. This is pure Libreoffice magic.

When I try to unprotect this also doesn't work. 
Tools, Protect Document, Document is not selected and Tools, Protect Sheet has a checkbox checked "Protect this sheet and the contents of protected cells" with empty user/pass. You cannot uncheck this as this disables the OK button.

The options selected here are "select protected cells" and "select unprotected cells". 

Infuriating.
Comment 1 Marc Schipperheyn 2013-12-02 18:51:54 UTC
It actually doesn't seem to happen out of nothing but occurs after running a macro that exports content from the sheets. The problem is resolved by closing and reopening the file.
Comment 2 sophie 2013-12-04 09:50:28 UTC
Hi, could you provide a spreadsheet with the macro to be able to reproduce and confirm the bug, please? Also, by default, all cells are protected, this protection is activated by protecting the sheet. May be you should disable protection of the cells (select the entire sheet, then Format > Cells > Protection > uncheck Protected) *before* running the macro. Sophie
Comment 3 sophie 2013-12-04 09:53:04 UTC
Removed blocker ans set to normal until we get more info to reproduce the bug and because it seems the macro is protecting the sheet.
Comment 4 Marc Schipperheyn 2013-12-04 12:15:12 UTC
Created attachment 90225 [details]
A stripped down version of the file with macro
Comment 5 QA Administrators 2014-07-08 17:28:46 UTC Comment hidden (obsolete)
Comment 6 QA Administrators 2014-08-04 16:14:54 UTC Comment hidden (obsolete)
Comment 7 Marc Schipperheyn 2014-08-04 17:15:54 UTC
Look the requested info was already provided 4-12-2013, judging from this bugreport
Comment 8 Joel Madero 2014-08-04 20:45:02 UTC
REOPENED is reserved for a bug that:

1. a developer has marked as FIXED;
2. a developer is assigned to the bug that is marked as FIXED;

In this case the bug report was never independently confirmed so correct status is UNCONFIRMED. Thanks!
Comment 9 Buovjaga 2014-11-05 13:09:19 UTC
(In reply to Marc Schipperheyn from comment #4)
> Created attachment 90225 [details]
> A stripped down version of the file with macro

File doesn't contain a macro.
Comment 10 Buovjaga 2015-05-01 15:55:15 UTC
Created attachment 115241 [details]
Backtrace of JS macro crash

Running the macro crashes LibO.
I got a backtrace of an access violation at the point of merely opening the Javascript macro organizer dialog.

Win 7 Pro 64-bit, Version: 4.4.3.2
Build ID: 88805f81e9fe61362df02b9941de8e38a9b5fd16
Locale: fi_FI
Comment 11 raal 2015-05-05 06:58:54 UTC
(In reply to Beluga from comment #10)
> Created attachment 115241 [details]
> Backtrace of JS macro crash
> 
> Running the macro crashes LibO.
> I got a backtrace of an access violation at the point of merely opening the
> Javascript macro organizer dialog.
> 
> Win 7 Pro 64-bit, Version: 4.4.3.2
> Build ID: 88805f81e9fe61362df02b9941de8e38a9b5fd16
> Locale: fi_FI

I can confirm crash with LO 4.4.2, win7.
Beluga, did you created bug report for crash? If not, I'll create one. Until crash is resolved, we cannot investigate more.
Comment 12 Buovjaga 2015-05-05 07:47:45 UTC
(In reply to raal from comment #11)
> I can confirm crash with LO 4.4.2, win7.
> Beluga, did you created bug report for crash? If not, I'll create one. Until
> crash is resolved, we cannot investigate more.

I went ahead and created a report bug 91092 :)
Comment 13 Matthew Francis 2015-05-06 03:54:40 UTC
I can reproduce this in versions prior to the (unrelated) issue which was split onto bug 91092.

From hacking the script up a bit, the issue for some reason seems to be triggered by the final

  xSheetsNameContainer.removeByName("tmp");


Setting -> NEW
Comment 14 Matthew Francis 2015-05-06 03:56:00 UTC
Created attachment 115376 [details]
Minimal reproducer

Attached is a spreadsheet with a minimal BASIC reproducer for the issue. After running the included macro, cells can no longer be edited.
Comment 15 Matthew Francis 2015-05-06 04:11:59 UTC
The behaviour of the issue is different in earlier releases, but I can't see it occur at all in OOo 3.3.0, and the macro already causes strange things to happen by LO 3.5 (variously, crashing or causing odd behaviour when editing cells), so let's call this a pre-bibisect regression.

As we now have a reproducer that isn't dependent on the unrelated JS issue, demoting bug 91092 from "Depends on" to "See Also"
Comment 16 Robinson Tryon (qubit) 2015-12-14 05:40:01 UTC Comment hidden (obsolete)
Comment 17 Commit Notification 2016-04-15 12:50:50 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=67abc250e5f30844797996e09e66e61c2ef214db

fix InsertTab and DeleteTab in ScMarkData, tdf#72240

It will be available in 5.2.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 18 Commit Notification 2016-04-15 12:50:54 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=4a2be39af5697356f2f4c0ae773f4b2530b2d9df

add test for tdf#72240

It will be available in 5.2.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.