aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-format-html-display.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2008-09-11 23:34:29 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-09-11 23:34:29 +0800
commitc0a255eb90769638d57ae4122932f75c46e4e531 (patch)
tree5213694107a246763c25c0a089553dd7c8708b32 /mail/em-format-html-display.c
parent4c8aa5982c0132716f473873d0e1d7601df14607 (diff)
downloadgsoc2013-evolution-c0a255eb90769638d57ae4122932f75c46e4e531.tar
gsoc2013-evolution-c0a255eb90769638d57ae4122932f75c46e4e531.tar.gz
gsoc2013-evolution-c0a255eb90769638d57ae4122932f75c46e4e531.tar.bz2
gsoc2013-evolution-c0a255eb90769638d57ae4122932f75c46e4e531.tar.lz
gsoc2013-evolution-c0a255eb90769638d57ae4122932f75c46e4e531.tar.xz
gsoc2013-evolution-c0a255eb90769638d57ae4122932f75c46e4e531.tar.zst
gsoc2013-evolution-c0a255eb90769638d57ae4122932f75c46e4e531.zip
Merge revisions 36016:36303 from trunk.
svn path=/branches/kill-bonobo/; revision=36307
Diffstat (limited to 'mail/em-format-html-display.c')
-rw-r--r--mail/em-format-html-display.c15
1 files changed, 13 insertions, 2 deletions
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 <camel/camel-cipher-context.h>
#include <camel/camel-folder.h>
#include <camel/camel-string-utils.h>
+#include <camel/camel-operation.h>
#include <misc/e-cursors.h>
#include <e-util/e-util.h>
@@ -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, "<td><object classid=\"%s\"></object></td>", 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);