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

git-svn-id: svn://10.0.0.236/trunk@159570 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
neil%parkwaycc.co.uk
2004-07-21 09:57:49 +00:00
parent 36fe9237b4
commit 7f0a5f976a

View File

@@ -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