From e7ebf59ed846007e232eadf7975bc71982ca19fc Mon Sep 17 00:00:00 2001 From: "bienvenu%nventure.com" Date: Fri, 20 Aug 2004 23:46:07 +0000 Subject: [PATCH] better fix for 242973, mapi send with ui with html compose and linebreaks, that doesn't break editing html drafts/templates, sr=mscott git-svn-id: svn://10.0.0.236/trunk@161085 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/mailnews/compose/src/nsMsgCompose.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mozilla/mailnews/compose/src/nsMsgCompose.cpp b/mozilla/mailnews/compose/src/nsMsgCompose.cpp index d41f292dc2b..1e00a1c2c5a 100644 --- a/mozilla/mailnews/compose/src/nsMsgCompose.cpp +++ b/mozilla/mailnews/compose/src/nsMsgCompose.cpp @@ -469,11 +469,6 @@ nsMsgCompose::ConvertAndLoadComposeWindow(nsString& aPrefix, TranslateLineEnding(aBuf); TranslateLineEnding(aSignature); - // this is probably a mapi send, so we need to replace '\n' with
- // so that the line breaks won't be lost by html. - if (!aQuoted && aHTMLEditor) - aBuf.ReplaceSubstring(NS_LITERAL_STRING("\n").get(), NS_LITERAL_STRING("
").get()); - // We're going to be inserting stuff, and MsgComposeCommands // may have set the editor to readonly in the recycled case. // So set it back to writable. @@ -3541,6 +3536,12 @@ nsMsgCompose::BuildBodyMessageAndSignature() if (addSignature) ProcessSignature(m_identity, PR_FALSE, &tSignature); + // if type is new, but we have body, this is probably a mapi send, so we need to + // replace '\n' with
so that the line breaks won't be lost by html. + // if mailtourl, do the same. + if (m_composeHTML && (mType == nsIMsgCompType::New || mType == nsIMsgCompType::MailToUrl)) + body.ReplaceSubstring(NS_LITERAL_STRING("\n").get(), NS_LITERAL_STRING("
").get()); + nsString empty; rv = ConvertAndLoadComposeWindow(empty, body, tSignature, PR_FALSE, m_composeHTML);