1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-13 03:03:15 +00:00

Refine r433663. If "use-header-bar" property of the dialog is set to TRUE,

it uses a GtkHeaderBar for action buttons instead of the action area and
gtk_dialog_get_header_bar() should not return NULL.  If it is set to FALSE,
gtk_dialog_get_header_bar() always returns NULL.  In other words, we should
not remove buttons from both header bar and action area in any case.  This
patch also removes pointless assertions from the previous patch.

PR:		203563
This commit is contained in:
Jung-uk Kim 2017-02-10 02:02:54 +00:00
parent 3faa0cc1f8
commit a0f9179a1a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=433781
2 changed files with 7 additions and 17 deletions

View File

@ -2,7 +2,7 @@
.include "${.CURDIR}/Makefile.common"
PORTREVISION= 4
PORTREVISION= 5
MASTER_SITES= http://download.documentfoundation.org/libreoffice/src/${PORTVERSION}/ \
http://dev-www.libreoffice.org/src/:src \
http://dev-www.libreoffice.org/extern/:ext

View File

@ -1,26 +1,16 @@
--- vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx.orig 2017-01-12 00:54:33 UTC
+++ vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
@@ -418,8 +418,11 @@ shrinkFilterName( const OUString &rFilte
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,10 +439,10 @@ dialog_remove_buttons( GtkDialog *pDialo
@@ -436,10 +436,13 @@ dialog_remove_buttons( GtkDialog *pDialo
{
g_return_if_fail( GTK_IS_DIALOG( pDialog ) );
-#if GTK_CHECK_VERSION(3,0,0)
#if GTK_CHECK_VERSION(3,12,0)
dialog_remove_buttons(gtk_dialog_get_header_bar(pDialog));
- 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
#endif
+#if GTK_CHECK_VERSION(2,14,0)
dialog_remove_buttons(gtk_dialog_get_action_area(pDialog));