Weird behavior when copying protected cells?

Using Windows 11
Version: 7.3.6.2 (x64) / LibreOffice Community
Build ID: c28ca90fd6e1a19e189fc16c05f8f8924961e12e

I’ve got a block of cells, some protected status and some not, that I have copied and pasted.

If the sheet is protected when I paste the block of cells, ALL the cells will be pasted with non-protected status.

If the sheet is NOT protected when I paste the cells, then all cells retain their original status, whether protected or unprotected.

This presents a conundrum, as I would generally like the sheet to always remain protected such that cells with formulas remain protected even when copied and pasted (there being no prohibition on such action in the sheet).

It seems counter-intuitive to have to Unprotect the sheet in order to paste Protected cells correctly.

Is there another way to copy and paste protected cells in a protected sheet, such that the cell status remains correct and the sheet protection remains unchanged?

1 Like

But, while the sheet is protected, it could be set [x] Protected to unprotected cells. But once set to Protected, although it can be undone (Ctrl+Z), it is not possible to set or unset other cells atributes (Ctrl+1).

Yes that is all true. I don’t understand how this explains the odd behavior though, and I would like to know if there’s any other way to copy protected cells to unprotected cells in a protected sheet and have them retain their protected status.

Of course there is such a way. When you put “Protected” in the cell properties, what considerations did you use? Is there any system in such notes? If so, you can use a custom style with “Protected” enabled and conditional formatting. Otherwise just use this custom style. Yes, this does not guarantee 100% protection against advanced users, but no one guarantees protection against them…

Not in all cases. I think there is a bug here. It seems that protected status only is pasted if the source cells belong to one row.
Test with the sample file:
some_cells_protected.ods (9.4 KB)
(8.4 KB) (password field is empty, A3:D4 get mine protected cell style).
If do you copy C1:E1 and paste in A1, status is retained. The same with C2:E2 in A2, and with A3:B3 in A1
But not if the source is C1:E2 in A1, nor with A3:B4 in A1.

Version: 7.2.7.2 (x64) / LibreOffice Community
Build ID: 8d71d29d553c0f7dcbfa38fbfda25ee34cce99a2
CPU threads: 4; OS: Windows 10.0 Build 19043; UI render: default; VCL: win
Locale: es-MX (es_ES); UI: en-US
Calc: CL

EDIT to add links to related bug reports.
https://bugs.documentfoundation.org/show_bug.cgi?id=123974
https://bugs.documentfoundation.org/show_bug.cgi?id=106965
https://bugs.documentfoundation.org/show_bug.cgi?id=143349

EDIT 2: Bug report: tdf#150910.

5 Likes

Indeed, that smells. Thanks for digging out bugs.

Thank you for submitting the Bug Report!
u/timur has marked this as a duplicate of bug 123974 … But it isn’t, is it?
That bug describes the ability (by default) to copy cell protection status in a protected sheet (which, to me, is not a bug… it’s exactly what I’m trying to accomplish).
The new bug ( Bug report: tdf#150910) describes the inability to correctly copy cell protection in a protected sheet when the copied range exceeds a single row.
Aren’t those completely different behaviors?