[gtk+/gtk-3-0] widget: Widgets always have a style, so no need to check for NULL



commit 7ef2c6a55f86140dbe697fd7fa443d775b7d29b0
Author: Benjamin Otte <otte redhat com>
Date:   Sat Mar 26 21:42:41 2011 +0100

    widget: Widgets always have a style, so no need to check for NULL

 gtk/gtkwidget.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 32ecd1e..b3a776c 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -7878,13 +7878,11 @@ gtk_widget_ensure_style (GtkWidget *widget)
 {
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
-  if (!widget->priv->style ||
-      widget->priv->style == gtk_widget_get_default_style ())
+  if (widget->priv->style == gtk_widget_get_default_style ())
     {
       GtkStyle *style;
 
-      if (widget->priv->style)
-        g_object_unref (widget->priv->style);
+      g_object_unref (widget->priv->style);
 
       style = g_object_new (GTK_TYPE_STYLE,
                             "context", gtk_widget_get_style_context (widget),



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]