# HG changeset patch # User Sean Egan # Date 1034142458 0 # Node ID 2043eca1b412a20d4285f500c27f1f17ad0f74ed # Parent 95669ff6dc3bf9419728cc91317a47dede3da47d [gaim-migrate @ 3728] Somewhat faster Pangonated gtkimhtml by Christian Hammond committer: Tailor Script diff -r 95669ff6dc3b -r 2043eca1b412 src/gtkimhtml.c --- a/src/gtkimhtml.c Wed Oct 09 05:46:02 2002 +0000 +++ b/src/gtkimhtml.c Wed Oct 09 05:47:38 2002 +0000 @@ -449,15 +449,17 @@ text_width(PangoContext *context, PangoFontDescription *desc, const char *text, gint len) { - PangoLayout *layout; + static PangoLayout *layout = NULL; int width; - layout = pango_layout_new(context); + if (layout == NULL) + layout = pango_layout_new(context); + pango_layout_set_font_description(layout, desc); pango_layout_set_text(layout, text, len); pango_layout_get_pixel_size(layout, &width, NULL); - g_object_unref(G_OBJECT(layout)); + /* g_object_unref(G_OBJECT(layout)); */ return width; }