Closed Bug 18716 Opened 26 years ago Closed 26 years ago

Mails composed in the HTML editor but sent as plain text aren't formatted.

Categories

(MailNews Core :: Composition, defect, P3)

defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: bratell, Assigned: rhp)

Details

Attachments

(1 file)

If you write a mail with the HTML composer and select Format->Plain Text or Mixed HTML and plain text it won't be formatted. Every paragraph is sent as a looooong line. The fix is to send in the right flags to the HTMLToTXT-converter. Patch: Index: nsMsgCompUtils.cpp =================================================================== RCS file: /cvsroot/mozilla/mailnews/compose/src/nsMsgCompUtils.cpp,v retrieving revision 1.46 diff -u -r1.46 nsMsgCompUtils.cpp --- nsMsgCompUtils.cpp 1999/11/09 03:04:25 1.46 +++ nsMsgCompUtils.cpp 1999/11/12 23:13:32 @@ -36,6 +36,7 @@ #include "nsMsgComposeStringBundle.h" #include "nsXPIDLString.h" #include "nsSpecialSystemDirectory.h" +#include "nsIDocumentEncoder.h" // for editor output flags /* for GET_xxx_PART */ #include "net.h" @@ -2157,8 +2158,22 @@ if (NS_SUCCEEDED(rv) && parser) { nsHTMLToTXTSinkStream *sink = nsnull; + PRUint32 converterFlags = 0; + PRUint32 wrapWidth = 72; + + converterFlags |= nsIDocumentEncoder::OutputFormatted; - rv = NS_New_HTMLToTXT_SinkStream((nsIHTMLContentSink **)&sink, &convertedText, 0, 0); + nsresult rv2; + NS_WITH_SERVICE(nsIPref, prefs, kPrefCID, &rv2); + if (NS_SUCCEEDED(rv2)) + { + PRBool sendflowed; + rv2=prefs->GetBoolPref("mailnews.send_plaintext_flowed", &sendflowed); + if(!NS_SUCCEEDED(rv2) || sendflowed) // Unless explicitly forbidden... + converterFlags |= nsIDocumentEncoder::OutputFormatFlowed; + } + + rv = NS_New_HTMLToTXT_SinkStream((nsIHTMLContentSink **)&sink, &convertedText, wrapWidth, converterFlags); if (sink && NS_SUCCEEDED(rv)) { sink->DoFragment(PR_TRUE);
Status: NEW → ASSIGNED
Target Milestone: M12
Reviewing patch and will checkin if all goes well :-) - rhp
Summary: Mails composed in the HTML editor but sent as plain text aren't formatted. → FIXED: Mails composed in the HTML editor but sent as plain text aren't formatted.
Looking good, but I just initialized the sendflowed variable to PR_TRUE. I don't think there is a defined behavior out of getting a pref when the pref is not found. I'll check this in the next time I stomp on the tree :-) Good work Daniel! You are a true Friend of the Tree!!! - rhp
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
Summary: FIXED: Mails composed in the HTML editor but sent as plain text aren't formatted. → Mails composed in the HTML editor but sent as plain text aren't formatted.
Checked in fixes for this tonight. - rhp
QA Contact: lchiang → pmock
Status: RESOLVED → VERIFIED
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: