summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorSerge Krot <Serge.Krot@cib.de>2018-12-17 17:07:23 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2019-01-18 19:11:40 +0100
commit46c6c414a6df79575517f5df67510d6f4e3d0128 (patch)
treedd340fab7d0a8ca590e0fa5228f5614b8870cc63 /sw/source
parent6808e1e5e2361220988dfa81cb35d03fb6e15855 (diff)
tdf#122201 sw: DOCX: allow editing of unprotected areas in protected doc
Change-Id: I5fb590745b733e2bfb934d946276857b65caf680 Reviewed-on: https://gerrit.libreoffice.org/65278 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-on: https://gerrit.libreoffice.org/65501 (cherry picked from commit 63ec2e8d07dff652a68c9dc96859c4c61f26b9df) Reviewed-on: https://gerrit.libreoffice.org/65502 Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/crsr/pam.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index 4e762bfcf218..3eaf288f7b30 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -597,6 +597,16 @@ bool SwPaM::HasReadonlySel( bool bFormView ) const
{
bRet = true;
}
+ else
+ {
+ const SwSectionNode* pParentSectionNd = pNd->FindSectionNode();
+ if ( pParentSectionNd != nullptr
+ && ( pParentSectionNd->GetSection().IsProtectFlag()
+ || ( bFormView && !pParentSectionNd->GetSection().IsEditInReadonlyFlag()) ) )
+ {
+ bRet = true;
+ }
+ }
}
if ( !bRet
@@ -701,7 +711,7 @@ bool SwPaM::HasReadonlySel( bool bFormView ) const
// touches fields, or fully encloses it), then don't disable editing
bRet = !( ( !pA || bAtStartA ) && ( !pB || bAtStartB ) );
}
- if( !bRet && pDoc->GetDocumentSettingManager().get( DocumentSettingId::PROTECT_FORM ) )
+ if( !bRet && pDoc->GetDocumentSettingManager().get( DocumentSettingId::PROTECT_FORM ) && (pA || pB) )
{
// Form protection case
bRet = ( pA == nullptr ) || ( pB == nullptr ) || bAtStartA || bAtStartB;