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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Sep 17 14:05:23 UTC 2018


 vcl/unx/gtk3/gtk3gtkinst.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 95401c5b3eef03497af6a85afc6e907c659ef6f7
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Sep 17 11:34:34 2018 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Sep 17 16:05:01 2018 +0200

    tweak combobox vs comboboxtext
    
    Change-Id: I3e183d2cc0b0372b961b295801887bc4aadeb3b3
    Reviewed-on: https://gerrit.libreoffice.org/60574
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 93f23b2b0e8e..28492d27d0dc 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -4673,7 +4673,8 @@ public:
         , m_nChangedSignalId(g_signal_connect(m_pComboBox, "changed", G_CALLBACK(signalChanged), this))
         , m_nPopupShownSignalId(g_signal_connect(m_pComboBox, "notify::popup-shown", G_CALLBACK(signalPopupShown), this))
     {
-        if (!has_entry())
+        GList* cells = gtk_cell_layout_get_cells(GTK_CELL_LAYOUT(m_pComboBox));
+        if (!g_list_length(cells))
         {
             //Always use the same text column renderer layout
             GtkCellRenderer* text_renderer = gtk_cell_renderer_text_new();
@@ -4685,7 +4686,6 @@ public:
         {
             // this bit isn't great, I really want to be able to ellipse the text in the comboboxtext itself and let
             // the popup menu render them in full, in the interim allow the text to wrap in both cases
-            GList* cells = gtk_cell_layout_get_cells(GTK_CELL_LAYOUT(m_pComboBox));
             GtkCellRenderer* cell = static_cast<GtkCellRenderer*>(cells->data);
             g_object_set(G_OBJECT(cell), "ellipsize", PANGO_ELLIPSIZE_MIDDLE, nullptr);
             if (g_list_length(cells) == 2)
@@ -4695,8 +4695,8 @@ public:
                 //column will be after it, but we want it before
                 gtk_cell_layout_reorder(GTK_CELL_LAYOUT(m_pComboBox), cell, 1);
             }
-            g_list_free(cells);
         }
+        g_list_free(cells);
 
         if (GtkEntry* pEntry = get_entry())
         {


More information about the Libreoffice-commits mailing list