[gtk+] scale: remove impossible case
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] scale: remove impossible case
- Date: Sun, 27 Mar 2016 05:45:02 +0000 (UTC)
commit 6efc06ef5c946c4fead4e411207a41ba154d3b31
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]