Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 338981 - Text VerifyEvent; Changing inserted text field inserts nothing or damages content
Summary: Text VerifyEvent; Changing inserted text field inserts nothing or damages con...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.1   Edit
Hardware: Macintosh Mac OS X
: P3 major (vote)
Target Milestone: 3.7 M6   Edit
Assignee: Lakshmi P Shanmugam CLA
QA Contact: Silenio Quarti CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-04 17:59 EST by Doug M CLA
Modified: 2011-03-08 23:50 EST (History)
1 user (show)

See Also:


Attachments
Demo of bug. (3.49 KB, application/octet-stream)
2011-03-04 18:02 EST, Doug M CLA
no flags Details
patch (992 bytes, patch)
2011-03-07 03:46 EST, Lakshmi P Shanmugam CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Doug M CLA 2011-03-04 17:59:08 EST
Build Identifier: swt-3.7M5-cocoa-macosx-x86_64

The text field of a VerifyEvent received by a Text's VerifyListener contains the text about to be inserted. Changing this field is supposed to alter the inserted text. Instead nothing is inserted, or the changed text is inserted while following parts of the Text's contents are deleted.

Reproducible: Always

Steps to Reproduce:
1. Run attached code. Single typed characters should be converted to "X".
2. Observe that typing in the top paragraph substitutes X but deletes following paragraphs.
3. Observe that typing in later paragraphs inserts nothing.
Comment 1 Doug M CLA 2011-03-04 18:02:12 EST
Created attachment 190456 [details]
Demo of bug.
Comment 2 Lakshmi P Shanmugam CLA 2011-03-07 03:46:41 EST
Created attachment 190518 [details]
patch

We are not computing the length of the selected range correctly. The patch gets the selected range directly from the NSTextView and uses it.
Silenio, please review the patch.
Comment 3 Silenio Quarti CLA 2011-03-07 12:29:34 EST
Patch is good to release.
Comment 4 Lakshmi P Shanmugam CLA 2011-03-07 14:52:01 EST
Thanks Silenio!
Fixed in HEAD > 20110308.