Fix for bug 184550. Don't need anymore to insert the document header separatly. That will avoid the performance regression as well. R=cavin, SR=bienvenu

This commit is contained in:
ducarroz%netscape.com 2002-12-11 00:14:27 +00:00
Родитель 6d2a521a22
Коммит 7c1a5bcb7e
1 изменённых файлов: 0 добавлений и 18 удалений

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

@ -547,22 +547,6 @@ nsMsgCompose::ConvertAndLoadComposeWindow(nsString& aPrefix,
PRInt32 start;
PRInt32 end;
nsAutoString bodyAttributes;
nsAutoString headContent;
/* Before we can insert the data into editor, we need to remove the <head> tag
content and then insert it back using ReplaceHeadContentsWithHTML */
start = aBuf.Find("<head>", PR_TRUE);
if (start != kNotFound)
{
start += 6; // move pass the <head> tag
end = aBuf.Find("</head>", PR_TRUE, start);
if (end != kNotFound)
{
const PRUnichar* data = aBuf.get();
headContent.Adopt(nsCRT::strndup(&data[start], end - start));
aBuf.Cut(start, end - start);
}
}
/* If we have attribute for the body tag, we need to save them in order
to add them back later as InsertSource will ignore them. */
@ -578,8 +562,6 @@ nsMsgCompose::ConvertAndLoadComposeWindow(nsString& aPrefix,
}
}
if (!headContent.IsEmpty())
htmlEditor->ReplaceHeadContentsWithHTML(headContent);
htmlEditor->InsertHTML(aBuf);
m_editor->EndOfDocument();