Bug 143100 - Disable cell style commands and sidebar when sheet is protected
Summary: Disable cell style commands and sidebar when sheet is protected
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected) alpha0+
Hardware: All All
: medium enhancement
Assignee: Not Assigned
Depends on:
Blocks: Calc-Styles
  Show dependency treegraph
Reported: 2021-06-28 11:50 UTC by Roman Kuznetsov
Modified: 2023-01-12 09:06 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description Roman Kuznetsov 2021-06-28 11:50:49 UTC
Calc doesn't allow to modify any cell style when you have a protected sheet in your spreadsheet. But when you try open the Cell style dialog using a context menu in Sidebar Calc silently doesn't show anything!

I suggest to add an error message "You can't change any cell styles. You have a protected sheet in your spreadsheet now" for this case

Steps to Reproduce:
1. Open a new Calc spreadsheet
2. Add two sheets
3. Protect any one sheet
4. select any unprotected sheet
5. Open Styles section in Sidebar (press F11)
6. Select Cell styles on top of the section
7. Right click on any style in list and select Modify from the context menu => Nothing happens

and I as an user just don't understand why I don't see the Cell style dialog. 

Actual Results:
Calc silently doesn't show the Cell style dialog

Expected Results:
Calc should show to user a some error message for this case like "You can't change any cell styles. You have a protected sheet in your spreadsheet now"

Reproducible: Always

User Profile Reset: No

Additional Info:
Version: (x64) / LibreOffice Community
Build ID: 6805efdecb240fad8c82a5c1756a2a0e92f12b7d
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Vulkan; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: threaded
Comment 1 Heiko Tietze 2021-07-02 09:38:46 UTC
You cannot apply a Cell Style to protected sheets, neither per content menu > Styles nor the main menu > Styles or the sidebar via deck Styles. In all cases the messagebox shows up "Protected sheets can not be modified".

In addition, it's not possible to modify the styles - otherwise you could turn red cells into green. And this fails silently.

However, I don't think the way to go is to pretend it works but show a message box telling the opposite. We should rather disable the Styles commands and the sidebar deck content if the sheet is protected.

Code pointer might be ScFormatShell::GetStyleState() in sc/source/ui/view/formatsh.cxx (but not sure).
Comment 2 Heiko Tietze 2022-03-16 16:05:57 UTC Comment hidden (off-topic)
Comment 3 Commit Notification 2022-03-16 18:30:41 UTC Comment hidden (off-topic)
Comment 4 Commit Notification 2023-01-08 09:20:13 UTC Comment hidden (off-topic)
Comment 5 Commit Notification 2023-01-10 09:49:29 UTC Comment hidden (off-topic)
Comment 6 Commit Notification 2023-01-12 09:05:13 UTC Comment hidden (off-topic)