[Libreoffice-commits] core.git: vcl/unx

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Oct 14 19:56:01 UTC 2020


 vcl/unx/gtk3/gtk3gtkinst.cxx |   20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

New commits:
commit a0e1c2e4ff7c89f284442d2e8cb2b1810a1d61f5
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Oct 14 17:22:38 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Oct 14 21:55:15 2020 +0200

    send ComboBox "changed" on autocomplete suggestion
    
    and put include_mru into its own function
    
    Change-Id: I9e7c669df7c538ae7271b16a0fdc31f102e9333f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104323
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 1db06d1cb1c2..9dcf0645c9d4 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -13726,7 +13726,10 @@ private:
         {
             OUString aText = get_text_including_mru(nPos);
             if (aText != aStartText)
-                set_active_text(aText);
+            {
+                SolarMutexGuard aGuard;
+                set_active_including_mru(nPos, true);
+            }
             select_entry_region(aText.getLength(), aStartText.getLength());
         }
         enable_notify_events();
@@ -14648,6 +14651,13 @@ private:
         return true;
     }
 
+    int include_mru(int pos)
+    {
+        if (m_nMRUCount && pos != -1)
+            pos += (m_nMRUCount + 1);
+        return pos;
+    }
+
 public:
     GtkInstanceComboBox(GtkBuilder* pComboBuilder, GtkComboBox* pComboBox, GtkInstanceBuilder* pBuilder, bool bTakeOwnership)
         : GtkInstanceContainer(GTK_CONTAINER(gtk_builder_get_object(pComboBuilder, "box")), pBuilder, bTakeOwnership)
@@ -14865,9 +14875,7 @@ public:
 
     virtual void set_active(int pos) override
     {
-        if (m_nMRUCount && pos != -1)
-            pos += (m_nMRUCount + 1);
-        set_active_including_mru(pos, false);
+        set_active_including_mru(include_mru(pos), false);
     }
 
     virtual OUString get_active_text() const override
@@ -14940,9 +14948,7 @@ public:
 
     virtual void insert(int pos, const OUString& rText, const OUString* pId, const OUString* pIconName, VirtualDevice* pImageSurface) override
     {
-        if (m_nMRUCount && pos != -1)
-            pos += (m_nMRUCount + 1);
-        insert_including_mru(pos, rText, pId, pIconName, pImageSurface);
+        insert_including_mru(include_mru(pos), rText, pId, pIconName, pImageSurface);
     }
 
     virtual void insert_separator(int pos, const OUString& rId) override


More information about the Libreoffice-commits mailing list