Sending wrong length when putting data on the clipboards,

double byte chars need twice the space. Wrongly assummed nsString.Length()
return bytes instead of length in chars doubel or single.
This commit is contained in:
rods%netscape.com 1999-07-23 02:25:17 +00:00
parent ee474fa908
commit 022dd79bc6
2 changed files with 6 additions and 2 deletions

View File

@ -1779,7 +1779,9 @@ PresShell::DoCopy()
trans->SetConverter(xifConverter);
// Now add the XIF data to the transferable
trans->SetTransferData(&flavor, buffer.ToNewUnicode(), buffer.Length());
// the transferable wants the number bytes for the data and since it is double byte
// we multiply by 2
trans->SetTransferData(&flavor, buffer.ToNewUnicode(), buffer.Length()*2);
//trans->SetTransferData(&flavor, buffer.ToNewCString(), buffer.Length());
// put the transferable on the clipboard

View File

@ -1779,7 +1779,9 @@ PresShell::DoCopy()
trans->SetConverter(xifConverter);
// Now add the XIF data to the transferable
trans->SetTransferData(&flavor, buffer.ToNewUnicode(), buffer.Length());
// the transferable wants the number bytes for the data and since it is double byte
// we multiply by 2
trans->SetTransferData(&flavor, buffer.ToNewUnicode(), buffer.Length()*2);
//trans->SetTransferData(&flavor, buffer.ToNewCString(), buffer.Length());
// put the transferable on the clipboard