sw/source/ui/fldui/fldref.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 1f909d67b4555b0ea7299e69af028dab54619007
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Mon Aug 5 21:23:40 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Tue Aug 6 10:39:16 2024 +0200

    Resolves: tdf#141398 auto-select first entry of filtered results
    
    apparent regression from:
    
    commit c403c86c6da4db0a6f2864ad4e13def9a3898cd4
    Author:     Caolán McNamara <caol...@redhat.com>
    AuthorDate: Sun Mar 17 19:22:08 2019 +0000
    
        weld SwFieldRefPage
    
        Change-Id: I5ae3965aa681ea1f5a005fbc8dad4d0ce36af1b3
        Reviewed-on: https://gerrit.libreoffice.org/69373
    
    Change-Id: Icb868403d31e1a6b57ae957f4eb98deafcc7f940
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171526
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    Tested-by: Jenkins

diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx
index 334f392f476f..57af7eea7bc1 100644
--- a/sw/source/ui/fldui/fldref.cxx
+++ b/sw/source/ui/fldui/fldref.cxx
@@ -790,12 +790,14 @@ void SwFieldRefPage::UpdateSubType(const OUString& 
filterString)
     m_xSelectionLB->set_visible( !bShowSelectionToolTipLB );
     if ( bShowSelectionToolTipLB )
     {
-        bool bEnable = m_xSelectionToolTipLB->n_children() != 0;
-        m_xSelection->set_sensitive( bEnable );
+        bool bHasChildren = m_xSelectionToolTipLB->n_children() != 0;
+        m_xSelection->set_sensitive(bHasChildren);
 
         int nEntry = m_xSelectionToolTipLB->get_selected_index();
         if (nEntry != -1)
             m_xSelectionToolTipLB->scroll_to_row(nEntry);
+        else if (bHasChildren)
+            m_xSelectionToolTipLB->select(0);
 
         if (IsFieldEdit() && nEntry == -1)
         {

Reply via email to