Closed
Bug 21021
Opened 26 years ago
Closed 26 years ago
Paste should take Unicode favor before text
Categories
(Core :: DOM: Editor, defect, P3)
Core
DOM: Editor
Tracking
()
VERIFIED
INVALID
M13
People
(Reporter: ftang, Assigned: nhottanscp)
References
()
Details
In nsHTMLEditor::Paste(). It ask for HTML, text and unicode favor from the
clipboard, but it *try* the text favor before try the Unicode favor. The order
should be reversed. We should always try the Unicode favor first since the
Unicode one contains more information, and the text one will always available
ina a data lostage way when the unicode one present. (This is done automatically
by Window system)
3526 else if (flavor.Equals(kTextMime))
3527 {
3528 nsCOMPtr<nsISupportsString> textDataObj (
do_QueryInterface(genericDataObj) );
3529 if (textDataObj && len > 0)
3530 {
3531 char* text = nsnull;
3532 textDataObj->ToString ( &text );
3533 stuffToPaste.SetString ( text, len );
3534 nsAutoEditBatch beginBatching(this);
3535 rv = InsertText(stuffToPaste);
3536 }
3537 }
3538 else if (flavor.Equals(kUnicodeMime))
3539 {
3540 nsCOMPtr<nsISupportsWString> textDataObj (
do_QueryInterface(genericDataObj) );
3541 if (textDataObj && len > 0)
3542 {
3543 PRUnichar* text = nsnull;
3544 textDataObj->ToString ( &text );
3545 stuffToPaste.SetString ( text, len / 2 );
3546 nsAutoEditBatch beginBatching(this);
3547 rv = InsertText(stuffToPaste);
3548 }
3549 }
The order of these two if block should be swaped
| Assignee | ||
Updated•26 years ago
|
Assignee: beppe → nhotta
Target Milestone: M13
| Assignee | ||
Comment 1•26 years ago
|
||
The code was done by me so I take this one. There are one more place (for
quoting) which needs to be fixed.
This is also the place we can do ACP to Unicode conversion (if kTextMime).
Comment 2•26 years ago
|
||
The order of these tests makes no difference. It's the order in which
AddDataFlavor is called which determines the precedence of data flavors, and it
is called for kUnicodeMime before it's called for kTextMime.
If you want to reverse the order of the clauses you mention, it's okay with me,
but it shouldn't have any effect on the code.
| Assignee | ||
Updated•26 years ago
|
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → INVALID
| Assignee | ||
Comment 3•26 years ago
|
||
So no changed is needed, marking as INALID.
So this bug was created from looking at the code, but the assumption was
incorrect. Has the actual correct behavior has been verified (try to paste
Unicode clipboard data first)?
| Assignee | ||
Comment 6•26 years ago
|
||
Currently, no ACP to unicode conversion is done for kTextMime. But paste works
for Japanese on Win32. That proves kUnicodeMime is used before kTextMime
otherwise we should see garbage characters for Japanese (because of no
conversion from ACP).
You need to log in
before you can comment on or make changes to this bug.
Description
•