[gtk2] Paste from Evolution to Composer will have garbage character

RESOLVED FIXED

Status

Core Graveyard
Embedding: GTK Widget
RESOLVED FIXED
15 years ago
6 years ago

People

(Reporter: Jerry, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

15 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20031021
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20031021

When paste from Evolution (using gtkhtml widget) to the composer of Mozilla, it
will have some garbage character after the paste content. It is caused by the
following code in nsClipboard.cpp:

length = selectionData->length * selectionData->format / 8;

When mozilla compute the length of the data from Clipboard, it uses
"selectionData"->format. Evolution set this value to 16, this will double the
actual length of data.

According to http://www.gtk.org/tutorial/sec-retrievingtheselection.html,
"format gives the length of the units (for instance characters) in bits.
Usually, you don't care about this when receiving data. data is a pointer to the
returned data, and length gives the length of the returned data, in bytes." If
so, the bug should be mozilla's guilt - Mozilla shouldn't have used
"selectionData->format" to compute the datalength and should use
"selectionData->length" directly because it's already in bytes. 

Reproducible: Always

Steps to Reproduce:
1.
2.
3.
(Reporter)

Updated

15 years ago
Component: GFX → Embedding: GTK Widget
(Reporter)

Comment 1

15 years ago
Created attachment 134382 [details] [diff] [review]
patch
(Reporter)

Updated

15 years ago
Attachment #134382 - Flags: review?(blizzard)
(Reporter)

Updated

15 years ago
Summary: Paste from Evolution to Composer will have garbage character → [gtk2] Paste from Evolution to Composer will have garbage character
Attachment #134382 - Flags: review?(blizzard) → review+

Updated

15 years ago
Attachment #134382 - Flags: superreview?(bolian.yin)

Updated

15 years ago
Attachment #134382 - Flags: superreview?(bolian.yin)
Attachment #134382 - Flags: review?(bolian.yin)
Attachment #134382 - Flags: review+

Comment 2

15 years ago
Comment on attachment 134382 [details] [diff] [review]
patch

blizzard, can you remove your review to superview? so I can check in this
patch. Thanks very much.
Attachment #134382 - Flags: superreview?(blizzard)
Attachment #134382 - Flags: superreview?(blizzard) → superreview+

Updated

15 years ago
Attachment #134382 - Flags: review?(yinbolian) → review?(robin.lu)

Updated

15 years ago
Attachment #134382 - Flags: review?(robin.lu) → review+

Comment 3

15 years ago
Comment on attachment 134382 [details] [diff] [review]
patch

The bug is important for gtk2 build since it influences Copy&Paste action to
evolution.
Attachment #134382 - Flags: approval1.7?

Comment 4

15 years ago
Comment on attachment 134382 [details] [diff] [review]
patch

a=asa (on behalf of drivers) for checkin to 1.7
Attachment #134382 - Flags: approval1.7? → approval1.7+

Comment 5

15 years ago
thanks. Patch checked in.
Status: NEW → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → FIXED
Component: Embedding: GTK Widget → Embedding: GTK Widget
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.