summaryrefslogtreecommitdiff
path: root/gtk/gtkaccellabel.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2004-11-03 06:36:32 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2004-11-03 06:36:32 +0000
commitf493d74d0a7e57a6c0768f0173e46938c2aecafd (patch)
treeb11b6602042971eb65f700c8c1c37d737efd1f52 /gtk/gtkaccellabel.c
parent9f3382613afed378fbb3fedebabadb6013dddac6 (diff)
downloadgtk+-f493d74d0a7e57a6c0768f0173e46938c2aecafd.tar.gz
Don't access label->layout directly. (#157080, Adam Hooper)
2004-11-03 Matthias Clasen <mclasen@redhat.com> * gtk/gtkaccellabel.c (gtk_accel_label_expose_event): Don't access label->layout directly. (#157080, Adam Hooper)
Diffstat (limited to 'gtk/gtkaccellabel.c')
-rw-r--r--gtk/gtkaccellabel.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gtk/gtkaccellabel.c b/gtk/gtkaccellabel.c
index 73b27e52a5..ab0ce47dc8 100644
--- a/gtk/gtkaccellabel.c
+++ b/gtk/gtkaccellabel.c
@@ -325,12 +325,14 @@ gtk_accel_label_expose_event (GtkWidget *widget,
gint x;
gint y;
+ label_layout = gtk_label_get_layout (GTK_LABEL (accel_label));
+
if (direction == GTK_TEXT_DIR_RTL)
widget->allocation.x += ac_width;
widget->allocation.width -= ac_width;
if (gtk_label_get_ellipsize (label))
- pango_layout_set_width (label->layout,
- pango_layout_get_width (label->layout)
+ pango_layout_set_width (label_layout,
+ pango_layout_get_width (label_layout)
- ac_width * PANGO_SCALE);
if (GTK_WIDGET_CLASS (parent_class)->expose_event)
@@ -339,8 +341,8 @@ gtk_accel_label_expose_event (GtkWidget *widget,
widget->allocation.x -= ac_width;
widget->allocation.width += ac_width;
if (gtk_label_get_ellipsize (label))
- pango_layout_set_width (label->layout,
- pango_layout_get_width (label->layout)
+ pango_layout_set_width (label_layout,
+ pango_layout_get_width (label_layout)
+ ac_width * PANGO_SCALE);
if (direction == GTK_TEXT_DIR_RTL)
@@ -348,7 +350,6 @@ gtk_accel_label_expose_event (GtkWidget *widget,
else
x = widget->allocation.x + widget->allocation.width - misc->xpad - ac_width;
- label_layout = gtk_label_get_layout (GTK_LABEL (accel_label));
gtk_label_get_layout_offsets (GTK_LABEL (accel_label), NULL, &y);
accel_layout = gtk_widget_create_pango_layout (widget, gtk_accel_label_get_string (accel_label));