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)
MailNews Core
Composition
Tracking
(Not tracked)
VERIFIED
FIXED
M12
People
(Reporter: bratell, Assigned: rhp)
Details
Attachments
(1 file)
|
1.45 KB,
patch
|
Details | Diff | Splinter Review |
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);
| Reporter | ||
Comment 1•26 years ago
|
||
| Assignee | ||
Updated•26 years ago
|
Status: NEW → ASSIGNED
Target Milestone: M12
| Assignee | ||
Comment 2•26 years ago
|
||
Reviewing patch and will checkin if all goes well :-)
- rhp
| Assignee | ||
Updated•26 years ago
|
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.
| Assignee | ||
Comment 3•26 years ago
|
||
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
| Assignee | ||
Updated•26 years ago
|
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.
| Assignee | ||
Comment 4•26 years ago
|
||
Checked in fixes for this tonight.
- rhp
Verified as fixed on win32, macos, and linux using the following builds:
ftp://sweetlou/products/client/seamonkey/windows/32bit/x86/1999-12-17-13-M12/seamonkey32e.exe
ftp://sweetlou/products/client/seamonkey/unix/linux_glibc/2.2/x86/1999-12-17-10-M12/netscape-i686-pc-linux-gnu.tar.gz
ftp://sweetlou/products/client/seamonkey/macos/8.x/ppc/1999-12-17-10-M12/NSMacInstaller-M12.sea.bin
Tested on new message and mixed message (html & plain text). No long line seen
in page source.
Updated•21 years ago
|
Product: MailNews → Core
Updated•17 years ago
|
Product: Core → MailNews Core
You need to log in
before you can comment on or make changes to this bug.
Description
•