sw/source/uibase/dochdl/gloshdl.cxx |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 8ee5952a13498ed68db00d3ee5dbe88cb0e7af2e
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Sat Nov 2 20:12:29 2024 +0000
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Mon Nov 4 11:47:44 2024 +0100

    Drop requirement that there is internal/shared autotext.
    
    A user's autotext was not examined unless there existed some
    internal/shared autotext. There seems to be no particular reason
    for that, except that internal/shared autotext happens to generally
    be available.
    
    Change-Id: I43a9fe5916d3a0895b175db52758104cc7fd65b3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175958
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sw/source/uibase/dochdl/gloshdl.cxx 
b/sw/source/uibase/dochdl/gloshdl.cxx
index e70ed7ffc4b2..b8d0d1277365 100644
--- a/sw/source/uibase/dochdl/gloshdl.cxx
+++ b/sw/source/uibase/dochdl/gloshdl.cxx
@@ -373,7 +373,7 @@ bool SwGlossaryHdl::ExpandGlossary(weld::Window* pParent)
         if(m_pWrtShell->IsSelection())
             aShortName = m_pWrtShell->GetSelText();
     }
-    return pGlossary && Expand(pParent, aShortName, &m_rStatGlossaries, 
std::move(pGlossary));
+    return Expand(pParent, aShortName, &m_rStatGlossaries, 
std::move(pGlossary));
 }
 
 bool SwGlossaryHdl::Expand(weld::Window* pParent, const OUString& rShortName,
@@ -386,7 +386,8 @@ bool SwGlossaryHdl::Expand(weld::Window* pParent, const 
OUString& rShortName,
     // search for text block
     // - don't prefer current group depending on configuration setting
     const SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
-    sal_uInt16 nFound = !rCfg.IsSearchInAllCategories() ? pGlossary->GetIndex( 
aShortName ) : -1;
+    sal_uInt16 nFound = (!rCfg.IsSearchInAllCategories() && pGlossary) ?
+        pGlossary->GetIndex( aShortName ) : -1;
     // if not found then search in all groups
     if( nFound == sal_uInt16(-1) )
     {
@@ -397,7 +398,7 @@ bool SwGlossaryHdl::Expand(weld::Window* pParent, const 
OUString& rShortName,
         {
             // get group name with path-extension
             const OUString sGroupName = pGlossaryList->GetGroupName(i);
-            if(sGroupName == pGlossary->GetName())
+            if (pGlossary && sGroupName == pGlossary->GetName())
                 continue;
             const sal_uInt16 nBlockCount = pGlossaryList->GetBlockCount(i);
             if(nBlockCount)

Reply via email to