[gtk+] fontchooser: Remove useless code
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] fontchooser: Remove useless code
- Date: Mon, 19 Sep 2011 20:15:24 +0000 (UTC)
commit a4c32718544f07287c335789e7ce61c767760899
Author: Benjamin Otte <otte redhat com>
Date: Mon Sep 19 20:37:38 2011 +0200
fontchooser: Remove useless code
gtk_adjustment_set_value() clamps itself, no need to do the clamping.
But I was impressed at the amount of comments.
gtk/gtkfontchooserwidget.c | 18 +-----------------
1 files changed, 1 insertions(+), 17 deletions(-)
---
diff --git a/gtk/gtkfontchooserwidget.c b/gtk/gtkfontchooserwidget.c
index cb23dbc..6d821d4 100644
--- a/gtk/gtkfontchooserwidget.c
+++ b/gtk/gtkfontchooserwidget.c
@@ -329,23 +329,7 @@ spin_change_cb (GtkAdjustment *adjustment,
else
pango_font_description_set_size (priv->font_desc, ((gint)size) * PANGO_SCALE);
- /* If the new value is lower than the lower bound of the slider, we set
- * the slider adjustment to the lower bound value if it is not already set
- */
- if (size < gtk_adjustment_get_lower (slider_adj) &&
- gtk_adjustment_get_value (slider_adj) != gtk_adjustment_get_lower (slider_adj))
- gtk_adjustment_set_value (slider_adj, gtk_adjustment_get_lower (slider_adj));
-
- /* If the new value is upper than the upper bound of the slider, we set
- * the slider adjustment to the upper bound value if it is not already set
- */
- else if (size > gtk_adjustment_get_upper (slider_adj) &&
- gtk_adjustment_get_value (slider_adj) != gtk_adjustment_get_upper (slider_adj))
- gtk_adjustment_set_value (slider_adj, gtk_adjustment_get_upper (slider_adj));
-
- /* If the new value is not already set on the slider we set it */
- else if (size != gtk_adjustment_get_value (slider_adj))
- gtk_adjustment_set_value (slider_adj, size);
+ gtk_adjustment_set_value (slider_adj, size);
gtk_widget_queue_draw (priv->preview);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]