Bug 120680 - Menu entries for shapes should be disabled in protected mode
Summary: Menu entries for shapes should be disabled in protected mode
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected) release
Hardware: All All
: low minor
Assignee: Not Assigned
Depends on:
Blocks: Cell-Sheet-Protection
  Show dependency treegraph
Reported: 2018-10-18 19:16 UTC by Xisco Faulí
Modified: 2021-01-05 08:41 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:
Regression By:


Note You need to log in before you can comment on or make changes to this bug.
Description Xisco Faulí 2018-10-18 19:16:39 UTC
Steps to Reproduce:
1. Take any sheet with protected cells, for example attachment 129104 [details]
2. Select one of the protected cells
3. Menu Insert > Shape > Any shape

Reproduced in

Build ID: 5fb66ae5595b7435e8954df31473fad15a74b8c2
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: en-US (ca_ES.UTF-8); Calc: threaded
Comment 1 Buovjaga 2018-12-27 16:21:58 UTC
Repro. Shape insertion was added to the menu somewhere between 5.0 and 5.3.
Comment 2 QA Administrators 2020-12-27 03:37:05 UTC Comment hidden (obsolete)
Comment 3 Xisco Faulí 2021-01-04 16:22:55 UTC
Still reproducible in

Build ID: 2c9708cbb870483a8a1c93d722085be5f789d234
CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

@Heiko, candidate for easyhack ?
Comment 4 Heiko Tietze 2021-01-05 08:41:26 UTC
(In reply to Xisco Faulí from comment #3)
> @Heiko, candidate for easyhack ?

Shapes are generic commands, not only used in Calc. There is .uno:BasicShapes and .uno:BasicShapes.rectangle, .uno:BasicShapes.quadrat etc. with SID_DRAWTBX_CS_BASIC and SID_DRAWTBX_CS_BASIC1.. SID_DRAWTBX_CS_BASIC<n>. All the children commands needs to be disabled individually.

I would think about a new state method, assign this to all SIDs, add the code similar to ScModule::GetState( SfxItemSet& rSet ). Maybe ScTable::IsProtected returns whether the sheet is protected. OTOH, such a state method requires Calc specific commands...

Usually I fail with the first approach and things are more complicated than expected. So not an easyhack.