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

Mark Page aptitude at btconnect.com
Thu Nov 9 13:14:34 UTC 2017


 vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

New commits:
commit 37a4c09145604a056f48f7484fe87e7d247a7af9
Author: Mark Page <aptitude at btconnect.com>
Date:   Wed Nov 8 15:23:35 2017 +0000

    Prevent GTK assertion with FilePicker dialog
    
    If "use-header-bar" property of the dialog is set to TRUE,
    it uses a GtkHeaderBar for action buttons instead of the
    action area.
    
    Change-Id: I9cebbce76d81ca50538e7d24133aa45e628d29b8
    Reviewed-on: https://gerrit.libreoffice.org/44490
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Mark Page <aptitude at btconnect.com>

diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
index 27841edde9c9..75e87e2eb5c7 100644
--- a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
+++ b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
@@ -416,8 +416,11 @@ shrinkFilterName( const OUString &rFilterName, bool bAllowNoStar = false )
 static void
 dialog_remove_buttons(GtkWidget *pActionArea)
 {
-    GList *pChildren =
-        gtk_container_get_children( GTK_CONTAINER( pActionArea ) );
+    GtkContainer *pContainer = GTK_CONTAINER( pActionArea );
+
+    g_return_if_fail( pContainer != nullptr );
+
+    GList *pChildren = gtk_container_get_children( pContainer );
 
     for( GList *p = pChildren; p; p = p->next )
     {
@@ -436,7 +439,11 @@ dialog_remove_buttons( GtkDialog *pDialog )
 
 #if GTK_CHECK_VERSION(3,0,0)
 #if GTK_CHECK_VERSION(3,12,0)
-    dialog_remove_buttons(gtk_dialog_get_header_bar(pDialog));
+    GtkWidget *pHeaderBar = gtk_dialog_get_header_bar(pDialog);
+    if( pHeaderBar != nullptr )
+        dialog_remove_buttons( pHeaderBar );
+    else
+        dialog_remove_buttons(gtk_dialog_get_action_area(pDialog));
 #endif
     dialog_remove_buttons(gtk_dialog_get_action_area(pDialog));
 #else


More information about the Libreoffice-commits mailing list