summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorHossein <hossein@libreoffice.org>2022-01-18 09:24:04 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2022-03-28 12:54:22 +0200
commitff0783ce6c74178ae44d6b5e402b0feecff918a9 (patch)
tree29af9e4d614a8e924de13a51ec03adafbe9fa1eb /sw
parentab9896bfda4d2ef16f3cbb373edced33f9021492 (diff)
tdf#146523 Fix editable protected drop-down fields
Previously, drop-down fields from a protected section in a Writer document could be edited by double-clicking on them. This patch adds a check to see if the appropriate section is protected or not. This check is done before allowing LibreOffice to open a popup window titled "Drop-down Form Field" for editing the list of possible values. Also, with this patch, menu item "Form > Control Properties..." will no longer do anything for the fields in a protected section. Change-Id: I02a23818bd315abd61118f199c72ac28b7ed1ab4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128256 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/shells/textsh1.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index e0f4459f31e9..4b94dc5b3b94 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1473,7 +1473,8 @@ void SwTextShell::Execute(SfxRequest &rReq)
pFieldBM = GetShell().getIDocumentMarkAccess()->getFieldmarkFor(aPos);
}
- if ( pFieldBM && pFieldBM->GetFieldname() == ODF_FORMDROPDOWN )
+ if ( pFieldBM && pFieldBM->GetFieldname() == ODF_FORMDROPDOWN
+ && !(rWrtSh.GetCurrSection() && rWrtSh.GetCurrSection()->IsProtect()) )
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
ScopedVclPtr<VclAbstractDialog> pDlg(pFact->CreateDropDownFormFieldDialog(rWrtSh.GetView().GetFrameWeld(), pFieldBM));