From dbd6de54a33998a3aaa71b66a733fed268ea21cf Mon Sep 17 00:00:00 2001 From: "ducarroz%netscape.com" Date: Tue, 19 Mar 2002 00:00:35 +0000 Subject: [PATCH] Fix for bug 107425. We need to force the entry point to the end of the document after we call InsertSource. R=varada, SR=bienvenu, A=asa git-svn-id: svn://10.0.0.236/trunk@116807 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/mailnews/compose/src/nsMsgCompose.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/mozilla/mailnews/compose/src/nsMsgCompose.cpp b/mozilla/mailnews/compose/src/nsMsgCompose.cpp index 00e3d80f7fa..f2c1ee39031 100644 --- a/mozilla/mailnews/compose/src/nsMsgCompose.cpp +++ b/mozilla/mailnews/compose/src/nsMsgCompose.cpp @@ -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 @@ -497,6 +497,7 @@ NS_IMETHODIMP nsMsgCompose::ConvertAndLoadComposeWindow(nsIEditorShell *aEditorS aEditorShell->InsertSource(aPrefix.get()); else aEditorShell->InsertText(aPrefix.get()); + editor->EndOfDocument(); } if (!aBuf.IsEmpty()) @@ -510,6 +511,7 @@ NS_IMETHODIMP nsMsgCompose::ConvertAndLoadComposeWindow(nsIEditorShell *aEditorS else aEditorShell->InsertAsQuotation(aBuf.get(), getter_AddRefs(nodeInserted)); + editor->EndOfDocument(); } (void)TagEmbeddedObjects(aEditorShell); @@ -547,7 +549,11 @@ NS_IMETHODIMP nsMsgCompose::ConvertAndLoadComposeWindow(nsIEditorShell *aEditorS } } + { aEditorShell->InsertSource(aBuf.get()); + editor->EndOfDocument(); + } + SetBodyAttributes(bodyAttributes); } if (!aSignature.IsEmpty()) @@ -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());