Bug 251686 Old body not deleted when switching out of HTML source mode r=glazou sr=dmose

This commit is contained in:
neil%parkwaycc.co.uk 2004-07-21 09:57:49 +00:00
Родитель b37360e0f5
Коммит 06cd01a9b0
1 изменённых файлов: 3 добавлений и 4 удалений

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

@ -1844,10 +1844,6 @@ nsHTMLEditor::RebuildDocumentFromSource(const nsAString& aSourceString)
// Time to change the document
nsAutoEditBatch beginBatching(this);
// Try to replace body contents first
res = SelectAll();
if (NS_FAILED(res)) return res;
nsReadingIterator<PRUnichar> endtotal;
aSourceString.EndReading(endtotal);
@ -1877,6 +1873,9 @@ nsHTMLEditor::RebuildDocumentFromSource(const nsAString& aSourceString)
}
if (NS_FAILED(res)) return res;
res = SelectAll();
if (NS_FAILED(res)) return res;
if (!foundbody) {
NS_NAMED_LITERAL_STRING(body, "<body>");
// XXX Without recourse to some parser/content sink/docshell hackery