From 6efc06ef5c946c4fead4e411207a41ba154d3b31 Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Sat, 26 Mar 2016 19:11:41 -0700 Subject: [PATCH] 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 | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c index 0b0c761637..17a2e8bfd9 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); - } - - 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; + 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); + + if (orientation == GTK_ORIENTATION_HORIZONTAL) + *minimum = *natural = logical_rect.width; + else + *minimum = *natural = logical_rect.height; } static void