Created attachment 151212 [details]
deleting_fieldmarks.doc: the three types of fieldmarks are easily deleted in protected sections
If the cursor is at the start of the formfield, then a delete will erase the entire field.
This problem started in LO 6.2 with https://cgit.freedesktop.org/libreoffice/core/commit/?h=libreoffice-4-4&id=63ec2e8d07dff652a68c9dc96859c4c61f26b9df for bug 122201.
author Serge Krot 2018-12-20 19:24:56 +0100
tdf#122201 sw: DOCX: allow editing of unprotected areas in protected doc
It looks like a delete request must pass several read-only checks, with Serge's change of meaning of the protect_form flag, all the tests pass. If a section is already protected, then the code follows a different path when evaluating whether fieldmarks are editable, so a different outcome occurs if the section is marked as protected.
Steps to reproduce:
1.) open the attached document and notice that each section is protected
2.) place the cursor in front of the checkbox and combobox and press delete.
The entire field is deleted. Also true with the textbox, although you really need to make sure you are at the beginning of the textbox definition.
A.) reload the test document
B.) edit the section and remove the protection.
C.) again attempt to delete the items
A "protected form" dialog tells you that editing here is not allowed. The checkbox and combobox cannot be deleted (because Options/Writer/Compatibility/Protect Forms is still enabled). The textbox can still be deleted however.
proposed fix at https://gerrit.libreoffice.org/71927
LO6.2's commit 63ec2e8d07dff652a68c9dc96859c4c61f26b9df accurately identfied that this is in a protected section, and so exposed this missing scenario.
Justin Luth committed a patch related to this issue.
It has been pushed to "master":
tdf#125151 sw: allow protection around field marks
It will be available in 6.3.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:
Affected users are encouraged to test the fix and report feedback.
I'm not planning to backport this to 6.2 where the problem was first seen - too much chance of some obscure edge case being blocked from editing etc.