[Libreoffice-commits] core.git: basctl/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Feb 11 16:24:48 UTC 2020


 basctl/source/basicide/IDEComboBox.cxx |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit bb861c972451af1ecdec75f37d32504167eff2ec
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Feb 11 12:53:12 2020 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Feb 11 17:24:09 2020 +0100

    ensure the module combobox gets updated with the current selection
    
    Change-Id: Ia9bf71c1890d9f2700a67ad9a3727dbf140c0492
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88446
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/basctl/source/basicide/IDEComboBox.cxx b/basctl/source/basicide/IDEComboBox.cxx
index 240eafb63d39..5279861365d1 100644
--- a/basctl/source/basicide/IDEComboBox.cxx
+++ b/basctl/source/basicide/IDEComboBox.cxx
@@ -208,7 +208,6 @@ void LibBox::FillBox()
 
     maCurrentText = m_xWidget->get_active_text();
 
-    m_xWidget->set_active(0);
     ClearBox();
 
     // create list box entries
@@ -229,7 +228,11 @@ void LibBox::FillBox()
 
     m_xWidget->thaw();
 
-    m_xWidget->set_active_text(maCurrentText);
+    int nIndex = m_xWidget->find_text(maCurrentText);
+    if (nIndex != -1)
+        m_xWidget->set_active(nIndex);
+    else
+        m_xWidget->set_active(0);
     maCurrentText = m_xWidget->get_active_text();
     mbIgnoreSelect = false;
 }
@@ -290,12 +293,9 @@ IMPL_LINK_NOARG(LibBox, FocusInHdl, weld::Widget&, void)
 
 IMPL_LINK_NOARG(LibBox, FocusOutHdl, weld::Widget&, void)
 {
-    if (!m_xWidget
-             ->has_focus()) // comboboxes can be comprised of multiple widgets, ensure all have lost focus
-    {
-        mbIgnoreSelect = true;
+    // comboboxes can be comprised of multiple widgets, ensure all have lost focus
+    if (!m_xWidget->has_focus())
         mbFillBox = true;
-    }
 }
 
 void LibBox::Select()


More information about the Libreoffice-commits mailing list