Tue, 27 Feb 2001 21:01:40 +0000
[gaim-migrate @ 1529]
faster is_smiley check
| src/gtkimhtml.c | file | annotate | diff | comparison | revisions | |
| src/gtkimhtml.h | file | annotate | diff | comparison | revisions |
--- a/src/gtkimhtml.c Tue Feb 27 18:41:11 2001 +0000 +++ b/src/gtkimhtml.c Tue Feb 27 21:01:40 2001 +0000 @@ -186,6 +186,8 @@ gdk_cursor_destroy (imhtml->arrow_cursor); g_hash_table_destroy (imhtml->smiley_hash); + if (imhtml->smiley_start) + g_string_free (imhtml->smiley_start, TRUE); if (GTK_OBJECT_CLASS (parent_class)->destroy != NULL) (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); @@ -1480,6 +1482,12 @@ if (strlen (text) > imhtml->smax) imhtml->smax = strlen (text); + if (!imhtml->smiley_start) + imhtml->smiley_start = g_string_new (""); + + if (!strchr (imhtml->smiley_start->str, text [0])) + imhtml->smiley_start = g_string_append_c (imhtml->smiley_start, text [0]); + if (xpm == NULL) g_hash_table_remove (imhtml->smiley_hash, text); else @@ -1805,6 +1813,9 @@ g_return_val_if_fail (GTK_IS_IMHTML (imhtml), 0); g_return_val_if_fail (text != NULL, 0); + if (!imhtml->smiley_start || !strchr (imhtml->smiley_start->str, text [0])) + return 0; + tmp = g_malloc (imhtml->smax + 1); for (i = imhtml->smin; i <= imhtml->smax; i++) {