зеркало из https://github.com/mozilla/gecko-dev.git
Fix problem with inline display - Bug #: 31238 - r: mscott - a: phil
This commit is contained in:
Родитель
95ee571b85
Коммит
9018c8dbc2
|
@ -253,7 +253,6 @@ test(FILE *in, FILE *out,
|
|||
|
||||
opt->fancy_headers_p = fancy_headers_p;
|
||||
opt->headers = MimeHeadersSome;
|
||||
opt->no_inline_p = PR_FALSE;
|
||||
opt->rot13_p = PR_FALSE;
|
||||
|
||||
status = mime_parse_url_options(url, opt);
|
||||
|
|
|
@ -457,58 +457,6 @@ mime_find_class (const char *content_type, MimeHeaders *hdrs,
|
|||
PR_ASSERT(clazz);
|
||||
if (!clazz) return 0;
|
||||
|
||||
/* If the `Show Attachments as Links' kludge is on, now would be the time
|
||||
to change our mind... */
|
||||
if (opts && opts->no_inline_p)
|
||||
{
|
||||
if (mime_subclass_p(clazz, (MimeObjectClass *)&mimeInlineTextClass))
|
||||
{
|
||||
/* It's a text type. Write it only if it's the *first* part
|
||||
that we're writing, and then only if it has no "filename"
|
||||
specified (the assumption here being, if it has a filename,
|
||||
it wasn't simply typed into the text field -- it was actually
|
||||
an attached document.) */
|
||||
if (opts->state && opts->state->first_part_written_p)
|
||||
clazz = (MimeObjectClass *)&mimeExternalObjectClass;
|
||||
else
|
||||
{
|
||||
/* If there's a name, then write this as an attachment. */
|
||||
char *name = (hdrs ? MimeHeaders_get_name(hdrs) : 0);
|
||||
if (name)
|
||||
clazz = (MimeObjectClass *)&mimeExternalObjectClass;
|
||||
PR_FREEIF(name);
|
||||
}
|
||||
|
||||
if (opts->state)
|
||||
opts->state->first_part_written_p = PR_TRUE;
|
||||
}
|
||||
else if (mime_subclass_p(clazz,(MimeObjectClass *)&mimeContainerClass) &&
|
||||
!mime_subclass_p(clazz,(MimeObjectClass *)&mimeMessageClass))
|
||||
/* Multipart subtypes are ok, except for messages; descend into
|
||||
multiparts, and defer judgement.
|
||||
|
||||
Xlateed blobs are just like other containers (make the xlation
|
||||
layer invisible, and treat them as simple containers. So there's
|
||||
no easy way to save xlated data directly to disk; it will tend
|
||||
to always be wrapped inside a message/rfc822. That's ok.)
|
||||
*/
|
||||
;
|
||||
else if (opts &&
|
||||
opts->part_to_load &&
|
||||
mime_subclass_p(clazz,(MimeObjectClass *)&mimeMessageClass))
|
||||
/* Descend into messages only if we're looking for a specific sub-part.
|
||||
*/
|
||||
;
|
||||
else
|
||||
{
|
||||
/* Anything else, and display it as a link (and cause subsequent
|
||||
text parts to also be displayed as links.) */
|
||||
clazz = (MimeObjectClass *)&mimeExternalObjectClass;
|
||||
if (opts->state)
|
||||
opts->state->first_part_written_p = PR_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
PR_ASSERT(clazz);
|
||||
|
||||
if (clazz && !clazz->class_initialized)
|
||||
|
@ -1157,13 +1105,6 @@ mime_parse_url_options(const char *url, MimeDisplayOptions *options)
|
|||
else
|
||||
options->rot13_p = PR_FALSE;
|
||||
}
|
||||
else if (!nsCRT::strncasecmp ("inline", q, name_end - q))
|
||||
{
|
||||
if (end <= value || !nsCRT::strncasecmp ("true", value, end - value))
|
||||
options->no_inline_p = PR_FALSE;
|
||||
else
|
||||
options->no_inline_p = PR_TRUE;
|
||||
}
|
||||
|
||||
q = end;
|
||||
if (*q)
|
||||
|
|
|
@ -86,7 +86,6 @@ extern "C" char *MIME_DecodeMimePartIIStr(const char *header,
|
|||
PRBool eatContinuations);
|
||||
|
||||
static MimeHeadersState MIME_HeaderType;
|
||||
static PRBool MIME_NoInlineAttachments;
|
||||
static PRBool MIME_WrapLongLines;
|
||||
static PRBool MIME_VariableWidthPlaintext;
|
||||
|
||||
|
@ -1231,13 +1230,6 @@ mime_bridge_create_display_stream(
|
|||
// Now, get the libmime prefs...
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
MIME_NoInlineAttachments = PR_TRUE; // false - display as links
|
||||
// true - display attachment
|
||||
|
||||
if (msd->options->prefs)
|
||||
msd->options->prefs->GetBoolPref("mail.inline_attachments", &MIME_NoInlineAttachments);
|
||||
MIME_NoInlineAttachments = !MIME_NoInlineAttachments;
|
||||
|
||||
/* This pref is written down in with the
|
||||
opposite sense of what we like to use... */
|
||||
MIME_WrapLongLines = PR_TRUE;
|
||||
|
@ -1249,7 +1241,6 @@ mime_bridge_create_display_stream(
|
|||
msd->options->prefs->GetBoolPref("mail.fixed_width_messages", &MIME_VariableWidthPlaintext);
|
||||
MIME_VariableWidthPlaintext = !MIME_VariableWidthPlaintext;
|
||||
|
||||
msd->options->no_inline_p = MIME_NoInlineAttachments;
|
||||
msd->options->wrap_long_lines_p = MIME_WrapLongLines;
|
||||
msd->options->headers = MIME_HeaderType;
|
||||
|
||||
|
|
|
@ -74,8 +74,8 @@ MimeInlineTextPlain_parse_begin (MimeObject *obj)
|
|||
char* s;
|
||||
strs[0] = "<PRE>";
|
||||
strs[1] = "<PRE style=\"font-family: serif;\">";
|
||||
strs[2] = "<PRE>";
|
||||
strs[3] = "<PRE style=\"font-family: serif;\">";
|
||||
strs[2] = "<PRE WRAP>";
|
||||
strs[3] = "<PRE WRAP style=\"font-family: serif;\">";
|
||||
|
||||
// For quoting, keep it simple...
|
||||
if ( (obj->options->format_out == nsMimeOutput::nsMimeMessageQuoting) ||
|
||||
|
|
|
@ -169,8 +169,6 @@ struct MimeDisplayOptions
|
|||
|
||||
PRBool rot13_p; /* Whether text/plain parts should be rotated
|
||||
Set by "?rot13=true" */
|
||||
PRBool no_inline_p; /* Whether inline display of attachments should
|
||||
be suppressed. Set by "?inline=false" */
|
||||
char *part_to_load; /* The particular part of the multipart which
|
||||
we are extracting. Set by "?part=3.2.4" */
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче