summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMark Page <aptitude@btconnect.com>2017-11-08 15:23:35 +0000
committerMark Page <aptitude@btconnect.com>2017-11-09 14:14:02 +0100
commit37a4c09145604a056f48f7484fe87e7d247a7af9 (patch)
tree5a14b6b173c579ac28a03697ed2a5af6fc1b86c8 /vcl
parent81b5f591dfe428efb3de278460ca662eacbf02bc (diff)
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@libreoffice.org> Reviewed-by: Mark Page <aptitude@btconnect.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx13
1 files changed, 10 insertions, 3 deletions
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