From c0a255eb90769638d57ae4122932f75c46e4e531 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 11 Sep 2008 15:34:29 +0000 Subject: Merge revisions 36016:36303 from trunk. svn path=/branches/kill-bonobo/; revision=36307 --- mail/em-format-html-display.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'mail/em-format-html-display.c') diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c index 199ff19b67..5bb9cc32d3 100644 --- a/mail/em-format-html-display.c +++ b/mail/em-format-html-display.c @@ -61,6 +61,7 @@ #include #include #include +#include #include #include @@ -1249,7 +1250,12 @@ efhd_image(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, EMFormat info->handle = handle; info->shown = TRUE; info->snoop_mime_type = ((EMFormat *) efh)->snoop_mime_type; - info->fit_width = ((GtkWidget *)((EMFormatHTML *)info->puri.format)->html)->allocation.width - 12; + if (camel_operation_cancel_check (NULL) || !info->puri.format || !((EMFormatHTML *)info->puri.format)->html) { + /* some fake value, we are cancelled anyway, thus doesn't matter */ + info->fit_width = 256; + } else { + info->fit_width = ((GtkWidget *)((EMFormatHTML *)info->puri.format)->html)->allocation.width - 12; + } camel_stream_printf(stream, "", classid); g_free(classid); @@ -2446,7 +2452,12 @@ efhd_format_optional(EMFormat *emf, CamelStream *fstream, CamelMimePart *part, C { char *classid, *html; struct _attach_puri *info; - CamelStream *stream = ((CamelStreamFilter *) fstream)->source; + CamelStream *stream; + + if (CAMEL_IS_STREAM_FILTER (fstream) && ((CamelStreamFilter *) fstream)->source) + stream = ((CamelStreamFilter *) fstream)->source; + else + stream = fstream; classid = g_strdup_printf("optional%s", emf->part_id->str); info = (struct _attach_puri *)em_format_add_puri(emf, sizeof(*info), classid, part, efhd_attachment_frame); -- cgit v1.2.3