[gtk+] widget: Widgets always have a style, so no need to check for NULL
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] widget: Widgets always have a style, so no need to check for NULL
- Date: Sat, 26 Mar 2011 23:55:08 +0000 (UTC)
commit 2bb64c868cc2ef847988ec23fb0b521345718e49
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 03fde15..b81d8ff 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -7877,13 +7877,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]