sw/source/ui/misc/glossary.cxx |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

New commits:
commit cf7c36eff41bc3c213b26cdeaf843277e46aade0
Author:     Tibor Nagy <tibor.nagy.ext...@allotropia.de>
AuthorDate: Sat Feb 1 10:36:59 2025 +0100
Commit:     Thorsten Behrens <thorsten.behr...@allotropia.de>
CommitDate: Sat Feb 1 16:26:26 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
    (cherry picked from commit 88741ef8c7aaa6d75ff99e44648087ff743937f1)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180998
    Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de>
    Tested-by: allotropia jenkins <jenk...@allotropia.de>

diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index 3fd85a31895a..00df21180053 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -239,8 +239,19 @@ SwGlossaryDlg::SwGlossaryDlg(SfxViewFrame const * 
pViewFrame,
 
     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();

Reply via email to