diff options
-rw-r--r-- | sw/inc/section.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/docnode/section.cxx | 23 |
2 files changed, 4 insertions, 21 deletions
diff --git a/sw/inc/section.hxx b/sw/inc/section.hxx index 06a173daec7f..b311f864cd26 100644 --- a/sw/inc/section.hxx +++ b/sw/inc/section.hxx @@ -73,7 +73,7 @@ private: /// may have different value than format attribute: /// format attr has value for this section, while flag is /// effectively ORed with parent sections! - bool m_bProtectFlag : 1; + bool m_bProtectFlag : 1; ///< protect flag is no longer inherited // Edit in readonly sections. bool m_bEditInReadonlyFlag : 1; diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx index ec77917bd30d..2e1a4cab6270 100644 --- a/sw/source/core/docnode/section.cxx +++ b/sw/source/core/docnode/section.cxx @@ -201,15 +201,11 @@ SwSection::SwSection( SwSection *const pParentSect = GetParent(); if( pParentSect ) { - m_Data.SetProtectFlag( pParentSect->IsProtectFlag() ); // edit in readonly sections m_Data.SetEditInReadonlyFlag( pParentSect->IsEditInReadonlyFlag() ); } - if (!m_Data.IsProtectFlag()) - { - m_Data.SetProtectFlag( rFormat.GetProtect().IsContentProtected() ); - } + m_Data.SetProtectFlag( rFormat.GetProtect().IsContentProtected() ); if (!m_Data.IsEditInReadonlyFlag()) // edit in readonly sections { @@ -457,21 +453,8 @@ void SwSection::SwClientNotify(const SwModify&, const SfxHint& rHint) { bool bNewFlag = static_cast<const SvxProtectItem*>(pNew)->IsContentProtected(); - if( !bNewFlag ) - { - // Switching off: See if there is protection transferred - // by the Parents - const SwSection* pSect = this; - do { - if( pSect->IsProtect() ) - { - bNewFlag = true; - break; - } - pSect = pSect->GetParent(); - } while (pSect); - } - + // this used to inherit the flag from the parent, but then there is + // no way to turn it off in an inner section m_Data.SetProtectFlag( bNewFlag ); } return; |