Mercurial > pidgin.yaz
comparison pidgin/gtkimhtml.c @ 17055:53e757c37e06
Ignore bold, underline and other formatting type things in SPAN tags if
"Show formatting on incoming messages" is turned off. This makes handling
of these things consistent with other formatting tags.
Fixes #520.
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Fri, 11 May 2007 20:06:57 +0000 |
parents | ab45289d2c36 |
children | 9f964a4834d9 |
comparison
equal
deleted
inserted
replaced
17043:8ad7750b0391 | 17055:53e757c37e06 |
---|---|
2759 { | 2759 { |
2760 font->underline = oldfont->underline; | 2760 font->underline = oldfont->underline; |
2761 } | 2761 } |
2762 if (textdec && font->underline != 1 | 2762 if (textdec && font->underline != 1 |
2763 && g_ascii_strcasecmp(textdec, "underline") == 0 | 2763 && g_ascii_strcasecmp(textdec, "underline") == 0 |
2764 && (imhtml->format_functions & GTK_IMHTML_UNDERLINE)) | 2764 && (imhtml->format_functions & GTK_IMHTML_UNDERLINE) |
2765 && !(options & GTK_IMHTML_NO_FORMATTING)) | |
2765 { | 2766 { |
2766 gtk_imhtml_toggle_underline(imhtml); | 2767 gtk_imhtml_toggle_underline(imhtml); |
2767 font->underline = 1; | 2768 font->underline = 1; |
2768 } else | 2769 } else |
2769 g_free(textdec); | 2770 g_free(textdec); |
2788 if(num >= 700) | 2789 if(num >= 700) |
2789 font->bold = 1; | 2790 font->bold = 1; |
2790 else | 2791 else |
2791 font->bold = 0; | 2792 font->bold = 0; |
2792 } | 2793 } |
2793 if ((font->bold && oldfont && !oldfont->bold) || (oldfont && oldfont->bold && !font->bold) || (font->bold && !oldfont)) | 2794 if (((font->bold && oldfont && !oldfont->bold) || (oldfont && oldfont->bold && !font->bold) || (font->bold && !oldfont)) && !(options & GTK_IMHTML_NO_FORMATTING)) |
2794 { | 2795 { |
2795 gtk_imhtml_toggle_bold(imhtml); | 2796 gtk_imhtml_toggle_bold(imhtml); |
2796 } | 2797 } |
2797 g_free(weight); | 2798 g_free(weight); |
2798 } | 2799 } |
2814 if (fonts) | 2815 if (fonts) |
2815 oldfont = fonts->data; | 2816 oldfont = fonts->data; |
2816 | 2817 |
2817 if (!oldfont) { | 2818 if (!oldfont) { |
2818 gtk_imhtml_font_set_size(imhtml, 3); | 2819 gtk_imhtml_font_set_size(imhtml, 3); |
2819 if (font->underline) | 2820 if (font->underline && !(options & GTK_IMHTML_NO_FORMATTING)) |
2820 gtk_imhtml_toggle_underline(imhtml); | 2821 gtk_imhtml_toggle_underline(imhtml); |
2821 if (font->bold) | 2822 if (font->bold && !(options & GTK_IMHTML_NO_FORMATTING)) |
2822 gtk_imhtml_toggle_bold(imhtml); | 2823 gtk_imhtml_toggle_bold(imhtml); |
2823 gtk_imhtml_toggle_fontface(imhtml, NULL); | 2824 if (!(options & GTK_IMHTML_NO_FONTS)) |
2824 gtk_imhtml_toggle_forecolor(imhtml, NULL); | 2825 gtk_imhtml_toggle_fontface(imhtml, NULL); |
2825 gtk_imhtml_toggle_backcolor(imhtml, NULL); | 2826 if (!(options & GTK_IMHTML_NO_COLOURS)) |
2827 gtk_imhtml_toggle_forecolor(imhtml, NULL); | |
2828 if (!(options & GTK_IMHTML_NO_COLOURS)) | |
2829 gtk_imhtml_toggle_backcolor(imhtml, NULL); | |
2826 } | 2830 } |
2827 else | 2831 else |
2828 { | 2832 { |
2829 | 2833 |
2830 if (font->size != oldfont->size) | 2834 if ((font->size != oldfont->size) && !(options & GTK_IMHTML_NO_SIZES)) |
2831 gtk_imhtml_font_set_size(imhtml, oldfont->size); | 2835 gtk_imhtml_font_set_size(imhtml, oldfont->size); |
2832 | 2836 |
2833 if (font->underline != oldfont->underline) | 2837 if ((font->underline != oldfont->underline) && !(options & GTK_IMHTML_NO_FORMATTING)) |
2834 gtk_imhtml_toggle_underline(imhtml); | 2838 gtk_imhtml_toggle_underline(imhtml); |
2835 | 2839 |
2836 if ((font->bold && !oldfont->bold) || (oldfont->bold && !font->bold)) | 2840 if (((font->bold && !oldfont->bold) || (oldfont->bold && !font->bold)) && !(options & GTK_IMHTML_NO_FORMATTING)) |
2837 gtk_imhtml_toggle_bold(imhtml); | 2841 gtk_imhtml_toggle_bold(imhtml); |
2838 | 2842 |
2839 if (font->face && (!oldfont->face || strcmp(font->face, oldfont->face) != 0)) | 2843 if (font->face && (!oldfont->face || strcmp(font->face, oldfont->face) != 0) && !(options & GTK_IMHTML_NO_FONTS)) |
2840 gtk_imhtml_toggle_fontface(imhtml, oldfont->face); | 2844 gtk_imhtml_toggle_fontface(imhtml, oldfont->face); |
2841 | 2845 |
2842 if (font->fore && (!oldfont->fore || strcmp(font->fore, oldfont->fore) != 0)) | 2846 if (font->fore && (!oldfont->fore || strcmp(font->fore, oldfont->fore) != 0) && !(options & GTK_IMHTML_NO_COLOURS)) |
2843 gtk_imhtml_toggle_forecolor(imhtml, oldfont->fore); | 2847 gtk_imhtml_toggle_forecolor(imhtml, oldfont->fore); |
2844 | 2848 |
2845 if (font->back && (!oldfont->back || strcmp(font->back, oldfont->back) != 0)) | 2849 if (font->back && (!oldfont->back || strcmp(font->back, oldfont->back) != 0) && !(options & GTK_IMHTML_NO_COLOURS)) |
2846 gtk_imhtml_toggle_backcolor(imhtml, oldfont->back); | 2850 gtk_imhtml_toggle_backcolor(imhtml, oldfont->back); |
2847 } | 2851 } |
2848 | 2852 |
2849 g_free (font->face); | 2853 g_free (font->face); |
2850 g_free (font->fore); | 2854 g_free (font->fore); |