Closed Bug 21208 Opened 25 years ago Closed 25 years ago

[DOGFOOD][Regression]copy and paste to plain text pastes html

Categories

(MailNews Core :: Composition, defect, P3)

Other
Other
defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: sspitzer, Assigned: akkzilla)

Details

in the plain text editor, or in plain text email, or in the subject line, if I copy and paste, I get html when I paste. if I copy "aaa" and paste I see <body style="white-space: -moz-pre-wrap; font-family: -moz-fixed; background-color: rgb(255,255,255); width: 80ch; ">aaa</body> I'm logging this with 5.0, so I created that by copying aaa and pasting it. I see this on windows and unix.
QA Contact: lchiang → sujay
qa contact to Sujay since this is in the plain text editor as well.
Assignee: beppe → akkana
I'll take this. It looks like we're pasting text/unicode, not text/html (previously we didn't even handle text/unicode), but we're passing the html source instead of converting to plaintext.
Summary: copy and paste to plain text pastes html → [DOGFOOD][Regression]copy and paste to plain text pastes html
Target Milestone: M12
this is a major regression with the copy/paste function, this should be a PDT+
Status: NEW → ASSIGNED
Whiteboard: Fix in hand, awaiting approval and code review
Turns out this is a problem in the clipboard, in nsXIFFormatConverter.cpp -- in the unicode case, it's calling ConvertFromXIFToHTML instead of ConvertFromXIFToText. I have a patch that fixes this, for English and for the Japanese characters on the editor test page (so as far as I can tell, it's really pasting html, not plaintext). Adding some I18n people so they keep me honest. Also adding Pinkerton, who owns the clipboard code; hoping he and/or Naoki can review this for me. Here's the patch: Index: nsXIFFormatConverter.cpp =================================================================== RCS file: /cvsroot/mozilla/widget/src/xpwidgets/nsXIFFormatConverter.cpp,v retrieving revision 1.23 diff -r1.23 nsXIFFormatConverter.cpp 252c252,257 < if ( NS_SUCCEEDED(ConvertFromXIFToHTML(dataStr, outStr)) ) { //еее shouldn't copy --- > nsresult res; > if (toFlavor.Equals(kHTMLMime)) > res = ConvertFromXIFToHTML(dataStr, outStr); > else > res = ConvertFromXIFToText(dataStr, outStr); > if ( NS_SUCCEEDED(res) ) { //еее shouldn't copy
patch looks good. while you're at it, remove the comment about it not copying. that was just for my reference, but isn't really important now.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Whiteboard: Fix in hand, awaiting approval and code review
Checked in. (I removed the comment, as suggested.)
Works much better now. Thanks and good job...
Status: RESOLVED → VERIFIED
verified in 12/9 build.
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.