sw/source/core/crsr/pam.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
New commits: commit 5dfd62ac0f5d21bbe53e5461d3976c351feb010c Author: Jim Raykowski <[email protected]> AuthorDate: Thu Nov 27 23:03:08 2025 -0900 Commit: Jim Raykowski <[email protected]> CommitDate: Tue Dec 2 21:39:23 2025 +0100 tdf#152030 Allow selection deletion of protected table of contents "Protect against manual changes" seems not the same as read-only when it comes to removing table of contents. For example, .uno:RemoveTableOf removes a table of content regardless of the "Protect against manual changes" setting. This patch changes the current behavior of displaying the read-only content write-protected info message to not displaying the message and allowing table of content deletion/cutting when the entire table of content is included in a selection. Change-Id: I4a14f0b1a17afbaacf211d7ddbe14f613761ebc5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194753 Reviewed-by: Jim Raykowski <[email protected]> Tested-by: Jenkins diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx index d59b37d28e49..c519f80c4bfc 100644 --- a/sw/source/core/crsr/pam.cxx +++ b/sw/source/core/crsr/pam.cxx @@ -834,7 +834,9 @@ bool SwPaM::HasReadonlySel(bool bFormView, bool const isReplace) const for( SwSectionFormats::size_type n = rFormats.size(); n; ) { const SwSectionFormat* pFormat = rFormats[ --n ]; - if( pFormat->GetProtect().IsContentProtected() ) + if (pFormat->GetSection()->GetType() != SectionType::ToxHeader + && pFormat->GetSection()->GetType() != SectionType::ToxContent + && pFormat->GetProtect().IsContentProtected()) { const SwFormatContent& rContent = pFormat->GetContent(false); OSL_ENSURE( rContent.GetContentIdx(), "where is the SectionNode?" );
