[gtk+] viewport: adjustments are never NULL



commit 5bacd8e019827968c650c41e16caaece3a6d84e8
Author: Benjamin Otte <otte redhat com>
Date:   Thu Nov 17 00:25:15 2011 +0100

    viewport: adjustments are never NULL
    
    So there's no need to check for that in the getters.

 gtk/gtkviewport.c |   18 ++----------------
 1 files changed, 2 insertions(+), 16 deletions(-)
---
diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c
index 68bf8f1..f38da08 100644
--- a/gtk/gtkviewport.c
+++ b/gtk/gtkviewport.c
@@ -362,16 +362,9 @@ viewport_get_view_allocation (GtkViewport   *viewport,
 GtkAdjustment*
 gtk_viewport_get_hadjustment (GtkViewport *viewport)
 {
-  GtkViewportPrivate *priv;
-
   g_return_val_if_fail (GTK_IS_VIEWPORT (viewport), NULL);
 
-  priv = viewport->priv;
-
-  if (!priv->hadjustment)
-    gtk_viewport_set_hadjustment (viewport, NULL);
-
-  return priv->hadjustment;
+  return viewport->priv->hadjustment;
 }
 
 /**
@@ -387,16 +380,9 @@ gtk_viewport_get_hadjustment (GtkViewport *viewport)
 GtkAdjustment*
 gtk_viewport_get_vadjustment (GtkViewport *viewport)
 {
-  GtkViewportPrivate *priv;
-
   g_return_val_if_fail (GTK_IS_VIEWPORT (viewport), NULL);
 
-  priv = viewport->priv;
-
-  if (!priv->vadjustment)
-    gtk_viewport_set_vadjustment (viewport, NULL);
-
-  return priv->vadjustment;
+  return viewport->priv->vadjustment;
 }
 
 static void



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