Bug 138168 - Programmatically setting/removing sheets protection doesn't change the sheets icons
Summary: Programmatically setting/removing sheets protection doesn't change the sheets...
Status: RESOLVED DUPLICATE of bug 133257
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.4.6.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected
Depends on:
Blocks:
 
Reported: 2020-11-12 18:22 UTC by Jean-Francois Nifenecker
Modified: 2021-11-07 08:04 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
A Calc file showing the problem (12.26 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-11-12 18:23 UTC, Jean-Francois Nifenecker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Francois Nifenecker 2020-11-12 18:22:16 UTC
Description:
When a (Basic) macro sets a sheet protection, the sheet lock icon is not updated (removed or added)

Steps to Reproduce:
1. Open the attached spreadsheet (accept macro execution)
The Sheet3 is currently protected. A lock icon is displayed in the tab.
2. In the Welcome sheet, click the "Unprotect" button
3. Enter the current password (test)
4. A message says that Sheet3 was unprotected.


Actual Results:
The lock icon remains in the tab after the sheet has been unlocked.

Expected Results:
The lock icon should be removed from the tab after the sheet has been unlocked.


Reproducible: Always


User Profile Reset: No



Additional Info:
Same bug also backwards: click the "Protect" button and set a password.
The icon is not displayed if the protection was not present beforehand.
Comment 1 Jean-Francois Nifenecker 2020-11-12 18:23:10 UTC
Created attachment 167241 [details]
A Calc file showing the problem
Comment 2 mulla.tasanim 2020-12-07 20:00:27 UTC
The lock icon has been removed from the tab after the sheet has been unlocked.

I can not reproduce bug in 

Version: 7.2.0.0.alpha0+ (x64)
Build ID: 761a672d62df1891b9f4f367a499b220ab2b33fa
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL

Version: 7.0.3.1 (x64)
Build ID: d7547858d014d4cf69878db179d326fc3483e082
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL
Comment 3 Timur 2021-04-05 12:39:24 UTC
Repro with LO 6.4.7
No repro master 7.2+.
So WFM, meaning it was fixed.
Comment 4 Timur 2021-04-05 12:52:23 UTC
I bibisected this to bug 133257, exact duplicate. 


I noticed that this macro doesn't work with empty password.

*** This bug has been marked as a duplicate of bug 133257 ***
Comment 5 Jean-Francois Nifenecker 2021-11-07 08:02:01 UTC
The bug is still present in:

Version: 7.1.3.2 / LibreOffice Community
Build ID: 47f78053abe362b9384784d31a6e56f8511eb1c1
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: fr-FR (fr_FR.UTF-8); UI: en-US
Calc: 


(Un)Setting a protection is not immediately shown in the UI tabs. Reloading the document actually shows the new status.


BTW: the reason why an empty password is not accepted is because of the way the OnProtectSheetsBtnClick() and OnUnprotectSheetsBtnClick() are set.
Comment 6 Jean-Francois Nifenecker 2021-11-07 08:04:55 UTC
Ooops! Saw the referenced bug https://bugs.documentfoundation.org/show_bug.cgi?id=138168

Seeems like this is fixed. I'll check under 7.2 which I'm not using at this moment and report there if necessary.