Description: Double clicking when inserting a shape inserts it into a layout layer that should have been locked. Steps to Reproduce: 1.Insert a new layer (Layer4). 2. Modify the layer “Layout” to “Lock”. 3. "Layer4" active. 4.Select "Rectangle" and double-click it on the page. Actual Results: The rectangle was not inserted on Layer 4, but on a locked layout layer. The layout layer is locked and cannot be selected. Expected Results: Rectangles are inserted on Layer 4 Reproducible: Always User Profile Reset: No Additional Info: Version: 24.2.6.2 (X86_64) / LibreOffice Community Build ID: ef66aa7e36a1bb8e65bfbc63aba53045a14d0871 CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win Locale: ja-JP (ja_JP); UI: en-US Calc: CL threaded
confirmed. Able to draw onto the 'Locked' layer. Interestingly if rather than the double-click of the STR, if the TB selected draw object is interactively drawn it will be added to the active layer and not the 'Locked' Layout layer. So this seems an implementation issue against bug 149141 - Allow object creation by clicking if drag size is below threshold in https://gerrit.libreoffice.org/c/core/+/134499 in place for 7.4 release. The target layer of the click-paste is not the active layer, and it is written in error to the 'Layout' layer--even if that layer is locked! =-testing-= Able to draw onto locked 'Layout' layer: Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 7198c5e49eff0b82cb423424eaed0ee94d66db7d CPU threads: 8; OS: Windows 10 X86_64 (10.0 build 19045); UI render: Skia/Vulkan; VCL: win Locale: en-US (en_US); UI: en-US Calc: CL threaded Version: 24.8.2.1 (X86_64) / LibreOffice Community Build ID: 0f794b6e29741098670a3b95d60478a65d05ef13 CPU threads: 8; OS: Windows 10 X86_64 (10.0 build 19045); UI render: Skia/Vulkan; VCL: win Locale: en-US (en_US); UI: en-US Calc: CL threaded Version: 24.2.6.2 (X86_64) / LibreOffice Community Build ID: ef66aa7e36a1bb8e65bfbc63aba53045a14d0871 CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win Locale: en-US (en_US); UI: en-US Calc: CL threaded Version: 7.6.6.3 (X86_64) / LibreOffice Community Build ID: d97b2716a9a4a2ce1391dee1765565ea469b0ae7 CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win Locale: en-US (en_US); UI: en-US Calc: CL threaded Version: 7.4.7.2 (x64) / LibreOffice Community Build ID: 723314e595e8007d3cf785c16538505a1c878ca5 CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win Locale: en-US (en_US); UI: en-US Calc: CL
Thanks you are both spot on! Seems to be that InsertObjectAtView(...) expects SdrInsertFlags::SETDEFLAYER flag. If you don't include it then the new objects' layer is not updated to current layer and it manages to bypass the lock.
The same happens, when a shape is inserted with Ctrl+Enter. (That is the accessibility short-cut for inserting shapes.) The shape is always inserted into layer "Layout", whether it is locked or not, even if a different layer is active layer. BTW, insert of a shape happens on single click for me. A double-click inserts and goes immediately in text edit mode for me.
Have a fix ready to go once I can get gerrit working. Would like to check with the Ctrl+Enter shortcut to see if it's the same issue/resolution. How would I enable this? If I try Ctrl+Enter at the moment it just creates a new page rather than inserts a shape. Thanks.
(In reply to Regina Henschel from comment #3) > BTW, insert of a shape happens on single click for me. A double-click > inserts and goes immediately in text edit mode for me. It certainly happened with a single click.
(In reply to AshSinc from comment #4) How > would I enable this? If I try Ctrl+Enter at the moment it just creates a new > page rather than inserts a shape. Thanks. View the Drawing toolbar. Then press F6 till the Drawing toolbar is selected, then go to the desired shape by pressing the arrow keys, then press Ctrl+Enter.
(In reply to AshSinc from comment #4) > Would like to check > with the Ctrl+Enter shortcut to see if it's the same issue/resolution. It might be not related, because this happens already in OpenOffice. Nevertheless it would be good to test, whether your fix has an effect on it.
(In reply to AshSinc from comment #4) patch up as https://gerrit.libreoffice.org/c/core/+/174420
So the patch solely fixes this bug by adding missing flags. Thanks Regina unfortunately it will not resolve the accessibility ctrl+enter problem. From a quick looking through the code the function InsertObjectAtView(...) is called frequently and sometimes has the layer flags set and other times has nothing set. I'm sure this is intentional in most cases (some things are probably drawn regardless of layers?) but maybe the ctrl+enter shortcut has also omitted the flag when it probably shouldn't have. I'm not sure where to find it though.
(In reply to AshSinc from comment #9) > Thanks Regina unfortunately it will not resolve the accessibility ctrl+enter > problem. From a quick looking through the code the function > InsertObjectAtView(...) is called frequently and sometimes has the layer > flags set and other times has nothing set. I'm sure this is intentional in > most cases (some things are probably drawn regardless of layers?) but maybe > the ctrl+enter shortcut has also omitted the flag when it probably shouldn't > have. I'm not sure where to find it though. So I would not touch it as this is a special accessibility short cut.
AshSinc committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/76fa6776c66ece5de9e871905054ea6a1a832c50 tdf#163251 Fix for missing flags in single click obj creation It will be available in 25.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.