[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sc/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Oct 29 10:54:38 UTC 2020


 sc/source/ui/dbgui/PivotLayoutDialog.cxx |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit e79b58403390c14e90224155d775eaba67d53d5c
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Oct 27 16:07:15 2020 +0000
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Thu Oct 29 11:54:07 2020 +0100

    avoid warning on set_active(0) on empty GtkComboBox
    
    i.e.
    
    gtk_tree_view_scroll_to_cell: assertion 'tree_view->priv->tree != NULL
    
    Change-Id: I48e7d015ec02ece407c732afebebb43c9c6fed48
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104843
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
index 788e81574810..08dcaf200ab9 100644
--- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
@@ -242,6 +242,8 @@ void ScPivotLayoutDialog::SetupSource()
         }
     }
 
+    bool bSourceBoxHasEntries = mxSourceListBox->get_count() > 0;
+
     if (bIsNamedRange)
     {
         mxSourceListBox->set_active_text(sSourceNamedRangeName);
@@ -249,12 +251,13 @@ void ScPivotLayoutDialog::SetupSource()
     }
     else
     {
-        mxSourceListBox->set_active(0);
+        // If entries - select first entry
+        mxSourceListBox->set_active(bSourceBoxHasEntries ? 0 : -1);
         mxSourceRadioSelection->set_active(true);
     }
 
-    // If entries - select first entry, otherwise disable the radio button.
-    if (mxSourceListBox->get_count() <= 0)
+    // If no entries disable the radio button.
+    if (!bSourceBoxHasEntries)
         mxSourceRadioNamedRange->set_sensitive(false);
 
     ToggleSource();


More information about the Libreoffice-commits mailing list