diff options
author | Michael Natterer <mitch@imendio.com> | 2008-02-06 09:53:34 +0000 |
---|---|---|
committer | Michael Natterer <mitch@src.gnome.org> | 2008-02-06 09:53:34 +0000 |
commit | e7355f82c2409f545210a8738bab262548f75e69 (patch) | |
tree | cf5729a1d44df53056bb9e67b355bd791994fb0f | |
parent | 0f1958e355b3c9948f0f1de4487c9a4ac57bda6f (diff) | |
download | gtk+-e7355f82c2409f545210a8738bab262548f75e69.tar.gz |
gtk/gtkcontainer.c gtk/gtkexpander.c gtk/gtkframe.c gtk/gtklabel.c
2008-02-06 Michael Natterer <mitch@imendio.com>
* gtk/gtkcontainer.c
* gtk/gtkexpander.c
* gtk/gtkframe.c
* gtk/gtklabel.c
* gtk/gtkmain.c
* gtk/gtkmenu.c
* gtk/gtkmenuitem.c
* gtk/gtkmenushell.c
* gtk/gtknotebook.c
* gtk/gtkseparatortoolitem.c
* gtk/gtksocket.c
* gtk/gtktextlayout.c
* gtk/gtktoggletoolbutton.c
* gtk/gtktoolbutton.c
* gtk/gtktoolitem.c
* gtk/gtktree.c
* gtk/gtktreeitem.c: replace "foo && GTK_IS_FOO (foo)" by simply
"GTK_IS_FOO (foo)".
svn path=/trunk/; revision=19481
-rw-r--r-- | ChangeLog | 21 | ||||
-rw-r--r-- | gtk/gtkcontainer.c | 4 | ||||
-rw-r--r-- | gtk/gtkexpander.c | 6 | ||||
-rw-r--r-- | gtk/gtkframe.c | 2 | ||||
-rw-r--r-- | gtk/gtklabel.c | 8 | ||||
-rw-r--r-- | gtk/gtkmain.c | 6 | ||||
-rw-r--r-- | gtk/gtkmenu.c | 2 | ||||
-rw-r--r-- | gtk/gtkmenuitem.c | 2 | ||||
-rw-r--r-- | gtk/gtkmenushell.c | 2 | ||||
-rw-r--r-- | gtk/gtknotebook.c | 14 | ||||
-rw-r--r-- | gtk/gtkseparatortoolitem.c | 2 | ||||
-rw-r--r-- | gtk/gtksocket.c | 4 | ||||
-rw-r--r-- | gtk/gtktextlayout.c | 2 | ||||
-rw-r--r-- | gtk/gtktoggletoolbutton.c | 2 | ||||
-rw-r--r-- | gtk/gtktoolbutton.c | 4 | ||||
-rw-r--r-- | gtk/gtktoolitem.c | 4 | ||||
-rw-r--r-- | gtk/gtktree.c | 4 | ||||
-rw-r--r-- | gtk/gtktreeitem.c | 2 |
18 files changed, 56 insertions, 35 deletions
@@ -1,3 +1,24 @@ +2008-02-06 Michael Natterer <mitch@imendio.com> + + * gtk/gtkcontainer.c + * gtk/gtkexpander.c + * gtk/gtkframe.c + * gtk/gtklabel.c + * gtk/gtkmain.c + * gtk/gtkmenu.c + * gtk/gtkmenuitem.c + * gtk/gtkmenushell.c + * gtk/gtknotebook.c + * gtk/gtkseparatortoolitem.c + * gtk/gtksocket.c + * gtk/gtktextlayout.c + * gtk/gtktoggletoolbutton.c + * gtk/gtktoolbutton.c + * gtk/gtktoolitem.c + * gtk/gtktree.c + * gtk/gtktreeitem.c: replace "foo && GTK_IS_FOO (foo)" by simply + "GTK_IS_FOO (foo)". + 2008-02-05 Matthias Clasen <mclasen@redhat.com> * gtk/gtkprintsettings.c (gtk_print_settings_get_page_ranges): diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c index ab238ec9d5..b4889ddf38 100644 --- a/gtk/gtkcontainer.c +++ b/gtk/gtkcontainer.c @@ -1867,8 +1867,8 @@ old_focus_coords (GtkContainer *container, { GtkWidget *widget = GTK_WIDGET (container); GtkWidget *toplevel = gtk_widget_get_toplevel (widget); - - if (toplevel && GTK_IS_WINDOW (toplevel) && GTK_WINDOW (toplevel)->focus_widget) + + if (GTK_IS_WINDOW (toplevel) && GTK_WINDOW (toplevel)->focus_widget) { GtkWidget *old_focus = GTK_WINDOW (toplevel)->focus_widget; diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c index e201e8ec0c..3172fdb24f 100644 --- a/gtk/gtkexpander.c +++ b/gtk/gtkexpander.c @@ -1552,7 +1552,7 @@ gtk_expander_get_label (GtkExpander *expander) priv = expander->priv; - if (priv->label_widget && GTK_IS_LABEL (priv->label_widget)) + if (GTK_IS_LABEL (priv->label_widget)) return gtk_label_get_text (GTK_LABEL (priv->label_widget)); else return NULL; @@ -1584,7 +1584,7 @@ gtk_expander_set_use_underline (GtkExpander *expander, { priv->use_underline = use_underline; - if (priv->label_widget && GTK_IS_LABEL (priv->label_widget)) + if (GTK_IS_LABEL (priv->label_widget)) gtk_label_set_use_underline (GTK_LABEL (priv->label_widget), use_underline); g_object_notify (G_OBJECT (expander), "use-underline"); @@ -1638,7 +1638,7 @@ gtk_expander_set_use_markup (GtkExpander *expander, { priv->use_markup = use_markup; - if (priv->label_widget && GTK_IS_LABEL (priv->label_widget)) + if (GTK_IS_LABEL (priv->label_widget)) gtk_label_set_use_markup (GTK_LABEL (priv->label_widget), use_markup); g_object_notify (G_OBJECT (expander), "use-markup"); diff --git a/gtk/gtkframe.c b/gtk/gtkframe.c index e118823204..73946f5338 100644 --- a/gtk/gtkframe.c +++ b/gtk/gtkframe.c @@ -349,7 +349,7 @@ gtk_frame_get_label (GtkFrame *frame) { g_return_val_if_fail (GTK_IS_FRAME (frame), NULL); - if (frame->label_widget && GTK_IS_LABEL (frame->label_widget)) + if (GTK_IS_LABEL (frame->label_widget)) return gtk_label_get_text (GTK_LABEL (frame->label_widget)); else return NULL; diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index cfe3df43aa..dd2cea3ec5 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -882,15 +882,15 @@ gtk_label_mnemonic_activate (GtkWidget *widget, */ parent = widget->parent; - if (parent && GTK_IS_NOTEBOOK (parent)) + if (GTK_IS_NOTEBOOK (parent)) return FALSE; while (parent) { if (GTK_WIDGET_CAN_FOCUS (parent) || (!group_cycling && GTK_WIDGET_GET_CLASS (parent)->activate_signal) || - (parent->parent && GTK_IS_NOTEBOOK (parent->parent)) || - (GTK_IS_MENU_ITEM (parent))) + GTK_IS_NOTEBOOK (parent->parent) || + GTK_IS_MENU_ITEM (parent)) return gtk_widget_mnemonic_activate (parent, group_cycling); parent = parent->parent; } @@ -949,7 +949,7 @@ gtk_label_setup_mnemonic (GtkLabel *label, mnemonic_menu = menu_shell; } - if (!(menu_shell && GTK_IS_MENU (menu_shell))) + if (!GTK_IS_MENU (menu_shell)) { gtk_window_add_mnemonic (GTK_WINDOW (toplevel), label->mnemonic_keyval, diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index b09afc3c3f..6749252c10 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -1636,7 +1636,7 @@ gtk_main_get_window_group (GtkWidget *widget) if (widget) toplevel = gtk_widget_get_toplevel (widget); - if (toplevel && GTK_IS_WINDOW (toplevel)) + if (GTK_IS_WINDOW (toplevel)) return gtk_window_get_group (GTK_WINDOW (toplevel)); else return gtk_window_get_group (NULL); @@ -2293,7 +2293,7 @@ gtk_propagate_event (GtkWidget *widget, GtkWidget *window; window = gtk_widget_get_toplevel (widget); - if (window && GTK_IS_WINDOW (window)) + if (GTK_IS_WINDOW (window)) { /* If there is a grab within the window, give the grab widget * a first crack at the key event @@ -2304,7 +2304,7 @@ gtk_propagate_event (GtkWidget *widget, if (!handled_event) { window = gtk_widget_get_toplevel (widget); - if (window && GTK_IS_WINDOW (window)) + if (GTK_IS_WINDOW (window)) { if (GTK_WIDGET_IS_SENSITIVE (window)) gtk_widget_event (window, event); diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c index 41b24b699d..f98658eced 100644 --- a/gtk/gtkmenu.c +++ b/gtk/gtkmenu.c @@ -1393,7 +1393,7 @@ gtk_menu_popup (GtkMenu *menu, } /* Set transient for to get the right window group and parent relationship */ - if (parent_toplevel && GTK_IS_WINDOW (parent_toplevel)) + if (GTK_IS_WINDOW (parent_toplevel)) gtk_window_set_transient_for (GTK_WINDOW (menu->toplevel), GTK_WINDOW (parent_toplevel)); diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c index 1801a66842..c7f00ff565 100644 --- a/gtk/gtkmenuitem.c +++ b/gtk/gtkmenuitem.c @@ -1618,7 +1618,7 @@ gtk_menu_item_set_accel_path (GtkMenuItem *menu_item, gtk_widget_set_accel_path (widget, NULL, NULL); /* install accelerators associated with new path */ - if (widget->parent && GTK_IS_MENU (widget->parent)) + if (GTK_IS_MENU (widget->parent)) { GtkMenu *menu = GTK_MENU (widget->parent); diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c index fc60f51dbc..f6d10a49ce 100644 --- a/gtk/gtkmenushell.c +++ b/gtk/gtkmenushell.c @@ -1016,7 +1016,7 @@ gtk_menu_shell_is_item (GtkMenuShell *menu_shell, g_return_val_if_fail (child != NULL, FALSE); parent = child->parent; - while (parent && GTK_IS_MENU_SHELL (parent)) + while (GTK_IS_MENU_SHELL (parent)) { if (parent == (GtkWidget*) menu_shell) return TRUE; diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index ab8b4f1a07..4fde43f85d 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -3655,7 +3655,7 @@ gtk_notebook_get_child_property (GtkContainer *container, case CHILD_PROP_TAB_LABEL: label = gtk_notebook_get_tab_label (notebook, child); - if (label && GTK_IS_LABEL (label)) + if (GTK_IS_LABEL (label)) g_value_set_string (value, GTK_LABEL (label)->label); else g_value_set_string (value, NULL); @@ -3663,7 +3663,7 @@ gtk_notebook_get_child_property (GtkContainer *container, case CHILD_PROP_MENU_LABEL: label = gtk_notebook_get_menu_label (notebook, child); - if (label && GTK_IS_LABEL (label)) + if (GTK_IS_LABEL (label)) g_value_set_string (value, GTK_LABEL (label)->label); else g_value_set_string (value, NULL); @@ -4427,9 +4427,9 @@ gtk_notebook_update_labels (GtkNotebook *notebook) } if (notebook->menu && page->default_menu) { - if (page->tab_label && GTK_IS_LABEL (page->tab_label)) + if (GTK_IS_LABEL (page->tab_label)) gtk_label_set_text (GTK_LABEL (page->menu_label), - GTK_LABEL (page->tab_label)->label); + GTK_LABEL (page->tab_label)->label); else gtk_label_set_text (GTK_LABEL (page->menu_label), string); } @@ -5929,7 +5929,7 @@ gtk_notebook_menu_item_create (GtkNotebook *notebook, page = list->data; if (page->default_menu) { - if (page->tab_label && GTK_IS_LABEL (page->tab_label)) + if (GTK_IS_LABEL (page->tab_label)) page->menu_label = gtk_label_new (GTK_LABEL (page->tab_label)->label); else page->menu_label = gtk_label_new (""); @@ -6981,7 +6981,7 @@ gtk_notebook_get_tab_label_text (GtkNotebook *notebook, tab_label = gtk_notebook_get_tab_label (notebook, child); - if (tab_label && GTK_IS_LABEL (tab_label)) + if (GTK_IS_LABEL (tab_label)) return gtk_label_get_text (GTK_LABEL (tab_label)); else return NULL; @@ -7116,7 +7116,7 @@ gtk_notebook_get_menu_label_text (GtkNotebook *notebook, menu_label = gtk_notebook_get_menu_label (notebook, child); - if (menu_label && GTK_IS_LABEL (menu_label)) + if (GTK_IS_LABEL (menu_label)) return gtk_label_get_text (GTK_LABEL (menu_label)); else return NULL; diff --git a/gtk/gtkseparatortoolitem.c b/gtk/gtkseparatortoolitem.c index 7d2331e09c..e1a57987b3 100644 --- a/gtk/gtkseparatortoolitem.c +++ b/gtk/gtkseparatortoolitem.c @@ -205,7 +205,7 @@ gtk_separator_tool_item_expose (GtkWidget *widget, if (priv->draw) { - if (widget->parent && GTK_IS_TOOLBAR (widget->parent)) + if (GTK_IS_TOOLBAR (widget->parent)) toolbar = GTK_TOOLBAR (widget->parent); _gtk_toolbar_paint_space_line (widget, toolbar, diff --git a/gtk/gtksocket.c b/gtk/gtksocket.c index ce0c0a6fad..1c99a988e4 100644 --- a/gtk/gtksocket.c +++ b/gtk/gtksocket.c @@ -360,7 +360,7 @@ _gtk_socket_end_embedding (GtkSocket *socket) GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (socket)); gint i; - if (toplevel && GTK_IS_WINDOW (toplevel)) + if (GTK_IS_WINDOW (toplevel)) _gtk_socket_windowing_end_embedding_toplevel (socket); g_object_unref (socket->plug_window); @@ -890,7 +890,7 @@ _gtk_socket_add_window (GtkSocket *socket, /* Add a pointer to the socket on our toplevel window */ toplevel = gtk_widget_get_toplevel (GTK_WIDGET (socket)); - if (toplevel && GTK_IS_WINDOW (toplevel)) + if (GTK_IS_WINDOW (toplevel)) gtk_window_add_embedded_xid (GTK_WINDOW (toplevel), xid); _gtk_socket_windowing_embed_notify (socket); diff --git a/gtk/gtktextlayout.c b/gtk/gtktextlayout.c index 3fab37d269..0c4db57c04 100644 --- a/gtk/gtktextlayout.c +++ b/gtk/gtktextlayout.c @@ -1821,7 +1821,7 @@ allocate_child_widgets (GtkTextLayout *text_layout, /* shaped_object is NULL for child anchors with no * widgets stored at them */ - if (shaped_object && GTK_IS_WIDGET (shaped_object)) + if (GTK_IS_WIDGET (shaped_object)) { PangoRectangle extents; diff --git a/gtk/gtktoggletoolbutton.c b/gtk/gtktoggletoolbutton.c index 4a83733209..88266463ac 100644 --- a/gtk/gtktoggletoolbutton.c +++ b/gtk/gtktoggletoolbutton.c @@ -193,7 +193,7 @@ gtk_toggle_tool_button_create_menu_proxy (GtkToolItem *item) const gchar *label_text = gtk_tool_button_get_label (tool_button); const gchar *stock_id = gtk_tool_button_get_stock_id (tool_button); - if (label_widget && GTK_IS_LABEL (label_widget)) + if (GTK_IS_LABEL (label_widget)) { label = gtk_label_get_label (GTK_LABEL (label_widget)); use_mnemonic = gtk_label_get_use_underline (GTK_LABEL (label_widget)); diff --git a/gtk/gtktoolbutton.c b/gtk/gtktoolbutton.c index 1555311701..a38da3ab31 100644 --- a/gtk/gtktoolbutton.c +++ b/gtk/gtktoolbutton.c @@ -614,7 +614,7 @@ gtk_tool_button_create_menu_proxy (GtkToolItem *item) gboolean use_mnemonic = TRUE; const char *label; - if (button->priv->label_widget && GTK_IS_LABEL (button->priv->label_widget)) + if (GTK_IS_LABEL (button->priv->label_widget)) { label = gtk_label_get_label (GTK_LABEL (button->priv->label_widget)); use_mnemonic = gtk_label_get_use_underline (GTK_LABEL (button->priv->label_widget)); @@ -638,7 +638,7 @@ gtk_tool_button_create_menu_proxy (GtkToolItem *item) else menu_item = gtk_image_menu_item_new_with_label (label); - if (button->priv->icon_widget && GTK_IS_IMAGE (button->priv->icon_widget)) + if (GTK_IS_IMAGE (button->priv->icon_widget)) { menu_image = clone_image_menu_size (GTK_IMAGE (button->priv->icon_widget), gtk_widget_get_settings (GTK_WIDGET (button))); diff --git a/gtk/gtktoolitem.c b/gtk/gtktoolitem.c index d86097ae9c..c6cbb8e776 100644 --- a/gtk/gtktoolitem.c +++ b/gtk/gtktoolitem.c @@ -1119,8 +1119,8 @@ gtk_tool_item_rebuild_menu (GtkToolItem *tool_item) g_return_if_fail (GTK_IS_TOOL_ITEM (tool_item)); widget = GTK_WIDGET (tool_item); - - if (widget->parent && GTK_IS_TOOL_SHELL (widget->parent)) + + if (GTK_IS_TOOL_SHELL (widget->parent)) gtk_tool_shell_rebuild_menu (GTK_TOOL_SHELL (widget->parent)); } diff --git a/gtk/gtktree.c b/gtk/gtktree.c index 72102f0ce6..a0731de306 100644 --- a/gtk/gtktree.c +++ b/gtk/gtktree.c @@ -473,7 +473,7 @@ gtk_tree_parent_set (GtkWidget *widget, GtkWidget *child; GList *children; - if (widget->parent && GTK_IS_TREE (widget->parent)) + if (GTK_IS_TREE (widget->parent)) { gtk_tree_unselect_all (tree); @@ -638,7 +638,7 @@ gtk_tree_remove_items (GtkTree *tree, else { GtkWidget *tmp = GTK_WIDGET (tree); - while (tmp->parent && GTK_IS_TREE (tmp->parent)) + while (GTK_IS_TREE (tmp->parent)) tmp = tmp->parent; root_tree = GTK_TREE (tmp); diff --git a/gtk/gtktreeitem.c b/gtk/gtktreeitem.c index 90e6f79cb2..17c1faaf19 100644 --- a/gtk/gtktreeitem.c +++ b/gtk/gtktreeitem.c @@ -784,7 +784,7 @@ gtk_real_tree_item_toggle (GtkItem *item) if(!GTK_WIDGET_IS_SENSITIVE(item)) return; - if (GTK_WIDGET (item)->parent && GTK_IS_TREE (GTK_WIDGET (item)->parent)) + if (GTK_IS_TREE (GTK_WIDGET (item)->parent)) gtk_tree_select_child (GTK_TREE (GTK_WIDGET (item)->parent), GTK_WIDGET (item)); else |