Comment 39 for bug 120281

Revision history for this message
In , Andrit (andrit) wrote :

Actually the first change ("\n" to NS_LINEBREAK) is not related and should be not considered. Sorry for noise. (It is buggy a bit - it probably will not work if say on Windows you will work with letter saved on Unix. This is the reason why i double the replace with " \n" and " \r\n" to make sure it will work with letters saved on any platform.)

Here is the final patch without this change:

diff -u -r1.460.2.28 nsMsgCompose.cpp
--- mailnews/compose/src/nsMsgCompose.cpp 8 Feb 2007 22:21:08 -0000 1.460.2.28
+++ mailnews/compose/src/nsMsgCompose.cpp 26 Mar 2007 05:26:16 -0000
@@ -3831,6 +3831,13 @@
   if (m_composeHTML && (mType == nsIMsgCompType::New || mType == nsIMsgCompType::MailToUrl))
     body.ReplaceSubstring(NS_LITERAL_STRING("\n").get(), NS_LITERAL_STRING("<br>").get());

+ if (!m_composeHTML) {
+ body.ReplaceSubstring(NS_LITERAL_STRING(" \n").get(),
+ NS_LITERAL_STRING(" ").get());
+ body.ReplaceSubstring(NS_LITERAL_STRING(" \r\n").get(),
+ NS_LITERAL_STRING(" ").get());
+ }
+
   nsString empty;
   rv = ConvertAndLoadComposeWindow(empty, body, tSignature,
                                    PR_FALSE, m_composeHTML);