sw/source/ui/misc/glossary.cxx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
New commits: commit 88741ef8c7aaa6d75ff99e44648087ff743937f1 Author: Tibor Nagy <tibor.nagy.ext...@allotropia.de> AuthorDate: Sat Feb 1 10:36:59 2025 +0100 Commit: Nagy Tibor <tibor.nagy.ext...@allotropia.de> CommitDate: Sat Feb 1 14:55:02 2025 +0100 tdf#146553 sw: Enable the AutoText dialog's Insert button in editable sections in read-only mode. Change-Id: I0fdf3a11f96ded8fe84cf9c81da2d6a020af3197 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180995 Reviewed-by: Nagy Tibor <tibor.nagy.ext...@allotropia.de> Tested-by: Jenkins diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx index 7a12be03473e..5ecad3698f8b 100644 --- a/sw/source/ui/misc/glossary.cxx +++ b/sw/source/ui/misc/glossary.cxx @@ -343,8 +343,19 @@ SwGlossaryDlg::SwGlossaryDlg(const SfxViewFrame& rViewFrame, ShowPreview(); - m_bIsDocReadOnly = m_pShell->GetView().GetDocShell()->IsReadOnly() || - m_pShell->HasReadonlySel(); + bool bIsInEditableSect = false; + bool bIsReadOnly = m_pShell->GetView().GetDocShell()->IsReadOnly(); + if (bIsReadOnly) + { + // If there is editable section in read-only mode, + // enable the use of the AutoText dialog's insert button + // within these sections. + const SwSection* pSection = m_pShell->GetCurrSection(); + if (pSection && pSection->IsEditInReadonly()) + bIsInEditableSect = true; + } + + m_bIsDocReadOnly = (bIsReadOnly || m_pShell->HasReadonlySel()) && !bIsInEditableSect; if( m_bIsDocReadOnly ) m_xInsertBtn->set_sensitive(false); m_xNameED->grab_focus();