[gtk+/gtk-3-20] scale: remove impossible case



commit 6e4312a49a1fcded6cb9ee63da6af8214b83c9f7
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Sat Mar 26 19:11:41 2016 -0700

    scale: remove impossible case
    
    We only create the gadget when the markup is not empty, so we don't
    need to check again here.

 gtk/gtkscale.c |   24 ++++++++++--------------
 1 files changed, 10 insertions(+), 14 deletions(-)
---
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index 0b0c761..17a2e8b 100644
--- a/gtk/gtkscale.c
+++ b/gtk/gtkscale.c
@@ -1539,26 +1539,22 @@ gtk_scale_measure_mark_label (GtkCssGadget   *gadget,
 {
   GtkWidget *widget = gtk_css_gadget_get_owner (gadget);
   GtkScaleMark *mark = user_data;
+  PangoRectangle logical_rect;
 
   *minimum = *natural = 0;
 
-  if (mark->markup)
+  if (!mark->layout)
     {
-      PangoRectangle logical_rect;
-
-      if (!mark->layout)
-        {
-          mark->layout = gtk_widget_create_pango_layout (widget, NULL);
-          pango_layout_set_markup (mark->layout, mark->markup, -1);
-        }
+      mark->layout = gtk_widget_create_pango_layout (widget, NULL);
+      pango_layout_set_markup (mark->layout, mark->markup, -1);
+    }
 
-      pango_layout_get_pixel_extents (mark->layout, NULL, &logical_rect);
+  pango_layout_get_pixel_extents (mark->layout, NULL, &logical_rect);
 
-      if (orientation == GTK_ORIENTATION_HORIZONTAL)
-        *minimum = *natural = logical_rect.width;
-      else
-        *minimum = *natural = logical_rect.height;
-    }
+  if (orientation == GTK_ORIENTATION_HORIZONTAL)
+    *minimum = *natural = logical_rect.width;
+  else
+    *minimum = *natural = logical_rect.height;
 }
 
 static void


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