[gtk+/treeview-refactor-staging] Removing an unused variable from GtkCellRendererText->get_preferred_width()
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/treeview-refactor-staging] Removing an unused variable from GtkCellRendererText->get_preferred_width()
- Date: Sat, 4 Dec 2010 05:23:56 +0000 (UTC)
commit bc3fa601672a003f05e7343e10a04e7d617c8e53
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Sat Dec 4 14:04:25 2010 +0900
Removing an unused variable from GtkCellRendererText->get_preferred_width()
gtk/gtkcellrenderertext.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkcellrenderertext.c b/gtk/gtkcellrenderertext.c
index 31ddd30..a61e8c6 100644
--- a/gtk/gtkcellrenderertext.c
+++ b/gtk/gtkcellrenderertext.c
@@ -2103,7 +2103,7 @@ gtk_cell_renderer_text_get_preferred_width (GtkCellRenderer *cell,
PangoContext *context;
PangoFontMetrics *metrics;
PangoRectangle rect;
- gint char_width, digit_width, char_pixels, text_width, ellipsize_chars, guess_width, xpad;
+ gint char_width, digit_width, char_pixels, text_width, ellipsize_chars, xpad;
gint min_width, nat_width;
/* "width-chars" Hard-coded minimum width:
@@ -2124,10 +2124,6 @@ gtk_cell_renderer_text_get_preferred_width (GtkCellRenderer *cell,
layout = get_layout (celltext, widget, NULL, 0);
- /* Get the layout with the text possibly wrapping at wrap_width */
- pango_layout_get_pixel_extents (layout, NULL, &rect);
- guess_width = rect.width;
-
/* Fetch the length of the complete unwrapped text */
pango_layout_set_width (layout, -1);
pango_layout_get_extents (layout, NULL, &rect);
@@ -2168,6 +2164,7 @@ gtk_cell_renderer_text_get_preferred_width (GtkCellRenderer *cell,
else
nat_width = xpad * 2 + PANGO_PIXELS (text_width);
+
nat_width = MAX (nat_width, min_width);
if (priv->max_width_chars > 0)
@@ -2183,7 +2180,6 @@ gtk_cell_renderer_text_get_preferred_width (GtkCellRenderer *cell,
if (natural_size)
*natural_size = nat_width;
-
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]