tdf#151190 sw content controls: make them read-write in protected sections
commitb138d6c12aaeb0b87dce15ea52dd134cf1abf6ac
authorMiklos Vajna <vmiklos@collabora.com>
Wed, 12 Oct 2022 09:44:49 +0000 (12 11:44 +0200)
committerMiklos Vajna <vmiklos@collabora.com>
Wed, 12 Oct 2022 11:55:45 +0000 (12 13:55 +0200)
treedb496cc4012e2c69c98c730aa1712de36f1e484b
parentcd79fbd624679f68662177fa25ebdfeaf7b2d3be
tdf#151190 sw content controls: make them read-write in protected sections

When the user picked a date in the date picker inside a protected
section, then we blocked the deletion of the placeholder, but allowed
insertion to the content control, which is inconsistent.

The trouble was that SwPaM::HasReadonlySel() detected that the cursor is
in a protected section, so deletion failed, leading to an ever growing
value of the content control.

Fix the problem by handling content controls similar to legacy form
fields: if the cursor is inside a content control, then that value is
editable, even if we're inside a protected section.

This is meant to fix all content control types, not just date pickers.

Change-Id: I9eca4c4f71dcfaa61d84414f7727adcd4496735c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141249
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
sw/qa/core/crsr/crsr.cxx
sw/source/core/crsr/pam.cxx