Fix bug 25610. We need to wrap the body into a <PRE> tag when forwarding inline a plain text message in HTML compose mode. R=rhp

This commit is contained in:
ducarroz%netscape.com 2000-02-01 01:59:46 +00:00
Родитель fc13fa7a57
Коммит c43de3492a
1 изменённых файлов: 23 добавлений и 3 удалений

Просмотреть файл

@ -221,7 +221,7 @@ mime_dump_attachments ( attachmentList );
if ((NS_FAILED(rv)) || (!msgComposeService)) if ((NS_FAILED(rv)) || (!msgComposeService))
return rv; return rv;
if (identity) if (identity && composeType == nsIMsgCompType::ForwardInline)
{ {
PRBool composeHtml = PR_FALSE; PRBool composeHtml = PR_FALSE;
identity->GetComposeHtml(&composeHtml); identity->GetComposeHtml(&composeHtml);
@ -1280,11 +1280,31 @@ mime_parse_stream_complete (nsMIMESession *stream)
// Since we have body text, then we should set the compose fields with // Since we have body text, then we should set the compose fields with
// this data. // this data.
if (composeFormat == nsIMsgCompFormat::PlainText) // if (composeFormat == nsIMsgCompFormat::PlainText)
fields->SetTheForcePlainText(PR_TRUE); // fields->SetTheForcePlainText(PR_TRUE);
if (forward_inline) if (forward_inline)
{ {
if (mdd->identity)
{
PRBool bFormat;
mdd->identity->GetComposeHtml(&bFormat);
if (bFormat)
{
if (body && composeFormat == nsIMsgCompFormat::PlainText)
{
char* newbody = (char *)PR_MALLOC (bodyLen + 12); //+11 chars for <pre> & </pre> tags
*newbody = 0;
PL_strcat(newbody, "<PRE>");
PL_strcat(newbody, body);
PL_strcat(newbody, "</PRE>");
PR_Free(body);
body = newbody;
composeFormat = nsIMsgCompFormat::HTML;
}
}
}
mime_insert_forwarded_message_headers(&body, mdd->headers, composeFormat, mime_insert_forwarded_message_headers(&body, mdd->headers, composeFormat,
mdd->mailcharset); mdd->mailcharset);
} }