зеркало из https://github.com/mozilla/gecko-dev.git
Fix for bug 170058: Body as "Plain Text" has no linebreaks and is displayed in variable font width
r=BenB, sr=bienvenu
This commit is contained in:
Родитель
8e992f87ae
Коммит
2311a0b84b
|
@ -94,9 +94,14 @@ MimeInlineTextHTMLAsPlaintext_parse_eof (MimeObject *obj, PRBool abort_p)
|
||||||
{
|
{
|
||||||
if (obj->closed_p)
|
if (obj->closed_p)
|
||||||
return 0;
|
return 0;
|
||||||
int status = ((MimeObjectClass*)&MIME_SUPERCLASS)->parse_eof(obj, abort_p);
|
|
||||||
|
// This is a hack. We need to call parse_eof() of the super class to flush out any buffered data.
|
||||||
|
// We can't call it yet for our direct super class, because it would "close" the output
|
||||||
|
// (write tags such as </pre> and </div>). We'll do that after parsing the buffer.
|
||||||
|
int status = ((MimeObjectClass*)&MIME_SUPERCLASS)->superclass->parse_eof(obj, abort_p);
|
||||||
if (status < 0)
|
if (status < 0)
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
MimeInlineTextHTMLAsPlaintext *textHTMLPlain =
|
MimeInlineTextHTMLAsPlaintext *textHTMLPlain =
|
||||||
(MimeInlineTextHTMLAsPlaintext *) obj;
|
(MimeInlineTextHTMLAsPlaintext *) obj;
|
||||||
|
|
||||||
|
@ -124,6 +129,16 @@ MimeInlineTextHTMLAsPlaintext_parse_eof (MimeObject *obj, PRBool abort_p)
|
||||||
|
|
||||||
cb.Truncate();
|
cb.Truncate();
|
||||||
|
|
||||||
|
if (status < 0)
|
||||||
|
return status;
|
||||||
|
|
||||||
|
// Second part of the flush hack. Pretend obj wasn't closed yet, so that our super class
|
||||||
|
// gets a chance to write the closing.
|
||||||
|
PRBool save_closed_p = obj->closed_p;
|
||||||
|
obj->closed_p = PR_FALSE;
|
||||||
|
status = ((MimeObjectClass*)&MIME_SUPERCLASS)->parse_eof(obj, abort_p);
|
||||||
|
// Restore closed_p.
|
||||||
|
obj->closed_p = save_closed_p;
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче