Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 311973 - StyledText's AccessibleTextExtendedListener#getText() problems for TEXT_BOUNDARY_WORD
Summary: StyledText's AccessibleTextExtendedListener#getText() problems for TEXT_BOUND...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.6   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.6 RC1   Edit
Assignee: Felipe Heidrich CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-06 16:50 EDT by Felipe Heidrich CLA
Modified: 2010-05-12 18:23 EDT (History)
2 users (show)

See Also:
carolynmacleod4: review+


Attachments
patch (1.61 KB, patch)
2010-05-06 17:03 EDT, Felipe Heidrich CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Felipe Heidrich CLA 2010-05-06 16:50:27 EDT
StyledText is returning some wrong values in AccessibleTextExtendedListener#getText() when the boundary type is 
TEXT_BOUNDARY_WORD.

For example, "hello world" the word at 6 (count=0) was returning "hello"
I saw the problem running linux's accerciser tool.
Comment 1 Felipe Heidrich CLA 2010-05-06 17:03:51 EDT
Created attachment 167398 [details]
patch

Some rules I followed for this patch

1) whitespaces are treat as trailing characters from the previous word
2) start is a word start and end is a word end
3) return "" when a word before the first word is requested
4) return "" when a word after the last word is requested

I was only able to test with 
start==end and count==0 -> atk getTextAtOffset()
start==end and count==-1 -> atk getTextBeforeOffset()
start==end and count==+1 -> atk getTextAfterOffset()
Comment 2 Felipe Heidrich CLA 2010-05-06 17:07:00 EDT
Note: the results from Text and StyledText as the native controls handles boundary type word start and word end, StyledText only handles boundary type word.

We can make the (atK) accessible object for StyledText answer the same values as Text by calling StyledText multiple times.
Comment 3 Felipe Heidrich CLA 2010-05-06 17:08:54 EDT
Sorry (I was in a bit of a rush), I meant to say
Note: the results from Text and StyledText ARE NOT THE SAME as the native control...
Comment 4 Carolyn MacLeod CLA 2010-05-07 14:10:24 EDT
I am very happy with this patch. I tested with both NVDA and JAWS, and I opened a WordPad with the same text, and StyledText works the same as WordPad now with both JAWS and NVDA. Please go ahead and commit this. You have my +1.
Comment 5 Felipe Heidrich CLA 2010-05-07 14:40:59 EDT
Fixed in HEAD > 20100507