sw/source/uibase/shells/textsh1.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit ff0783ce6c74178ae44d6b5e402b0feecff918a9
Author:     Hossein <hoss...@libreoffice.org>
AuthorDate: Tue Jan 18 09:24:04 2022 +0100
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Mon Mar 28 12:54:22 2022 +0200

    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.st...@allotropia.de>

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));

Reply via email to