Skip to content

Commit

Permalink
Fix for bug 107425. We need to force the entry point to the end of th…
Browse files Browse the repository at this point in the history
…e document after we call InsertSource. R=varada, SR=bienvenu, A=asa
  • Loading branch information
ducarroz%netscape.com committed Mar 19, 2002
1 parent c3db3cd commit 4766631
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions mailnews/compose/src/nsMsgCompose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,9 +477,9 @@ NS_IMETHODIMP nsMsgCompose::ConvertAndLoadComposeWindow(nsIEditorShell *aEditorS
TranslateLineEnding(aBuf);
TranslateLineEnding(aSignature);

aEditorShell->GetEditor(getter_AddRefs(editor));
nsresult rv = aEditorShell->GetEditor(getter_AddRefs(editor));
NS_ENSURE_SUCCESS(rv, rv);

if (editor)
editor->EnableUndo(PR_FALSE);

// Ok - now we need to figure out the charset of the aBuf we are going to send
Expand All @@ -497,6 +497,7 @@ NS_IMETHODIMP nsMsgCompose::ConvertAndLoadComposeWindow(nsIEditorShell *aEditorS
aEditorShell->InsertSource(aPrefix.get());
else
aEditorShell->InsertText(aPrefix.get());
editor->EndOfDocument();
}

if (!aBuf.IsEmpty())
Expand All @@ -510,6 +511,7 @@ NS_IMETHODIMP nsMsgCompose::ConvertAndLoadComposeWindow(nsIEditorShell *aEditorS
else
aEditorShell->InsertAsQuotation(aBuf.get(),
getter_AddRefs(nodeInserted));
editor->EndOfDocument();
}

(void)TagEmbeddedObjects(aEditorShell);
Expand Down Expand Up @@ -547,7 +549,11 @@ NS_IMETHODIMP nsMsgCompose::ConvertAndLoadComposeWindow(nsIEditorShell *aEditorS
}
}

{
aEditorShell->InsertSource(aBuf.get());
editor->EndOfDocument();
}

SetBodyAttributes(bodyAttributes);
}
if (!aSignature.IsEmpty())
Expand All @@ -556,7 +562,10 @@ NS_IMETHODIMP nsMsgCompose::ConvertAndLoadComposeWindow(nsIEditorShell *aEditorS
else
{
if (!aBuf.IsEmpty())
{
aEditorShell->InsertText(aBuf.get());
editor->EndOfDocument();
}

if (!aSignature.IsEmpty())
aEditorShell->InsertText(aSignature.get());
Expand Down

0 comments on commit 4766631

Please sign in to comment.