Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 311973

Summary: StyledText's AccessibleTextExtendedListener#getText() problems for TEXT_BOUNDARY_WORD
Product: [Eclipse Project] Platform Reporter: Felipe Heidrich <eclipse.felipe>
Component: SWTAssignee: Felipe Heidrich <eclipse.felipe>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: carolynmacleod4, Silenio_Quarti
Version: 3.6Flags: carolynmacleod4: review+
Target Milestone: 3.6 RC1   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
patch none

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