# HG changeset patch # User Sadrul Habib Chowdhury # Date 1211476488 0 # Node ID 9f94bf3743c2b0cc5f2b3a010c0ba15b9935ff1e # Parent 28dae90906e13ceab0550b8946032270dbaba141 Fix exporting proper HTML for tags. diff -r 28dae90906e1 -r 9f94bf3743c2 pidgin/gtkimhtml.c --- a/pidgin/gtkimhtml.c Thu May 22 00:07:01 2008 +0000 +++ b/pidgin/gtkimhtml.c Thu May 22 17:14:48 2008 +0000 @@ -1574,9 +1574,11 @@ gtk_text_buffer_create_tag(imhtml->text_buffer, "SUP", "rise", 5000, NULL); gtk_text_buffer_create_tag(imhtml->text_buffer, "PRE", "family", "Monospace", NULL); gtk_text_buffer_create_tag(imhtml->text_buffer, "search", "background", "#22ff00", "weight", "bold", NULL); + gtk_text_buffer_create_tag(imhtml->text_buffer, "comment", "weight", PANGO_WEIGHT_NORMAL, #if FALSE && GTK_CHECK_VERSION(2,10,10) - gtk_text_buffer_create_tag(imhtml->text_buffer, "comment", "invisible", FALSE, NULL); + "invisible", FALSE, #endif + NULL); gtk_text_buffer_create_tag(imhtml->text_buffer, "send-name", "weight", PANGO_WEIGHT_BOLD, NULL); gtk_text_buffer_create_tag(imhtml->text_buffer, "receive-name", "weight", PANGO_WEIGHT_BOLD, NULL); @@ -3124,7 +3126,7 @@ #else if (imhtml->show_comments && !(options & GTK_IMHTML_NO_COMMENTS)) { wpos = g_snprintf (ws, len, "%s", tag); - gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos); + gtk_text_buffer_insert_with_tags_by_name(imhtml->text_buffer, iter, ws, wpos, "comment", NULL); } #endif ws[0] = '\0'; wpos = 0; @@ -4994,7 +4996,67 @@ g_snprintf(buf, sizeof(buf), "", &name[10]); return buf; } else { - return ""; + char *str = buf; + gboolean isset; + int ivalue = 0; + GdkColor *color = NULL; + GObject *obj = G_OBJECT(tag); + gboolean empty = TRUE; + + str += g_snprintf(str, sizeof(buf) - (str - buf), ""); + + return (empty ? "" : buf); } } @@ -5026,6 +5088,16 @@ } else if (strncmp(name, "FONT SIZE ", 10) == 0) { return ""; } else { + const char *props[] = {"weight-set", "foreground-set", "background-set", + "size-set", "underline-set", NULL}; + int i; + for (i = 0; props[i]; i++) { + gboolean set = FALSE; + g_object_get(G_OBJECT(tag), props[i], &set, NULL); + if (set) + return ""; + } + return ""; } }