зеркало из https://github.com/mozilla/pjs.git
Separated the menu charset code from the charset initialization function,
to avoid the mail font code calling the init function and reset the menu charset, bug 150530, r=ducarroz, sr=bienvenu.
This commit is contained in:
Родитель
9e5297c92c
Коммит
05a5fa5e87
|
@ -485,11 +485,18 @@ MimeMessage_close_headers (MimeObject *obj)
|
|||
( obj->options->part_to_load == NULL )
|
||||
)
|
||||
{
|
||||
char *charset = NULL;
|
||||
char *lct = MimeHeaders_get (msg->hdrs, HEADER_CONTENT_TYPE,
|
||||
PR_FALSE, PR_FALSE);
|
||||
if (lct)
|
||||
charset = MimeHeaders_get_parameter (lct, "charset", NULL, NULL);
|
||||
// call SetMailCharacterSetToMsgWindow() to set a menu charset
|
||||
if (mime_typep(body, (MimeObjectClass *) &mimeInlineTextClass))
|
||||
{
|
||||
MimeInlineText *text = (MimeInlineText *) body;
|
||||
if (text && text->charset && *text->charset)
|
||||
{
|
||||
if (!nsCRT::strcasecmp(text->charset, "us-ascii"))
|
||||
SetMailCharacterSetToMsgWindow(body, NS_LITERAL_STRING("ISO-8859-1").get());
|
||||
else
|
||||
SetMailCharacterSetToMsgWindow(body, NS_ConvertASCIItoUCS2(text->charset).get());
|
||||
}
|
||||
}
|
||||
|
||||
char *msgID = MimeHeaders_get (msg->hdrs, HEADER_MESSAGE_ID,
|
||||
PR_FALSE, PR_FALSE);
|
||||
|
@ -500,8 +507,6 @@ MimeMessage_close_headers (MimeObject *obj)
|
|||
|
||||
mimeEmitterStartBody(obj->options, (obj->options->headers == MimeHeadersNone), msgID, outCharset);
|
||||
PR_FREEIF(msgID);
|
||||
PR_FREEIF(lct);
|
||||
PR_FREEIF(charset);
|
||||
|
||||
// setting up truncated message html fotter function
|
||||
char *xmoz = MimeHeaders_get(msg->hdrs, HEADER_X_MOZILLA_STATUS, PR_FALSE,
|
||||
|
|
|
@ -173,14 +173,6 @@ static int MimeInlineText_initializeCharset(MimeObject *obj)
|
|||
}
|
||||
}
|
||||
|
||||
//update MsgWindow charset if we are instructed to do so
|
||||
if (text->needUpdateMsgWinCharset && *text->charset) {
|
||||
if (!nsCRT::strcasecmp(text->charset, "us-ascii"))
|
||||
SetMailCharacterSetToMsgWindow(obj, NS_LITERAL_STRING("ISO-8859-1").get());
|
||||
else
|
||||
SetMailCharacterSetToMsgWindow(obj, NS_ConvertASCIItoUCS2(text->charset).get());
|
||||
}
|
||||
|
||||
text->initializeCharset = PR_TRUE;
|
||||
|
||||
return 0;
|
||||
|
@ -521,7 +513,16 @@ MimeInlineText_rotate_convert_and_parse_line(char *line, PRInt32 length,
|
|||
MimeInlineText *text = (MimeInlineText *) obj;
|
||||
|
||||
if (!text->initializeCharset)
|
||||
{
|
||||
MimeInlineText_initializeCharset(obj);
|
||||
//update MsgWindow charset if we are instructed to do so
|
||||
if (text->needUpdateMsgWinCharset && *text->charset) {
|
||||
if (!nsCRT::strcasecmp(text->charset, "us-ascii"))
|
||||
SetMailCharacterSetToMsgWindow(obj, NS_LITERAL_STRING("ISO-8859-1").get());
|
||||
else
|
||||
SetMailCharacterSetToMsgWindow(obj, NS_ConvertASCIItoUCS2(text->charset).get());
|
||||
}
|
||||
}
|
||||
|
||||
//if autodetect is on, push line to dam
|
||||
if (text->inputAutodetect)
|
||||
|
|
Загрузка…
Ссылка в новой задаче