| Summary: | Up and Down arrow keys don't work in RTL text | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Mohsen Saboorian <mohsens> | ||||
| Component: | SWT | Assignee: | Felipe Heidrich <eclipse.felipe> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | daniel_megert, eclipse.felipe | ||||
| Version: | 3.7.1 | ||||||
| Target Milestone: | 3.8 M4 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Mohsen Saboorian
Created attachment 206307 [details]
A UTF-8 file to reproduce this behavior
After opening file in eclipse, press Ctrl+Enter and change file encoding to UTF-8. Then go to a sample line, say 5 and press End. Now go Up, and Down. Down will not work.
The reason is a StringIndexOutOfBoundsException in TextLayout.getOffset(...). It can also be reproduced via CustomControlExample. 1. launch the CustomControlExample 2. change font to Consolas 10 3. select vertical and horizontal fill 4. paste the text from the attached file 5. on line 7 place the caret after "personal" 6. press Downwards_Arrow ==> Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 14 at java.lang.String.charAt(String.java:686) at org.eclipse.swt.graphics.TextLayout.getOffset(TextLayout.java:2269) at org.eclipse.swt.custom.StyledText.getOffsetAtPoint(StyledText.java:4405) at org.eclipse.swt.custom.StyledText.doLineDown(StyledText.java:2610) at org.eclipse.swt.custom.StyledText.invokeAction(StyledText.java:6871) at org.eclipse.swt.custom.StyledText.handleKey(StyledText.java:5926) at org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:5952) at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:5646) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1104) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1100) at org.eclipse.swt.widgets.Widget.wmKeyDown(Widget.java:1809) at org.eclipse.swt.widgets.Control.WM_KEYDOWN(Control.java:4892) at org.eclipse.swt.widgets.Control.windowProc(Control.java:4560) at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4972) at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method) at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:2428) at org.eclipse.swt.internal.BidiUtil.windowProc(BidiUtil.java:639) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2534) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3752) at org.eclipse.swt.examples.controlexample.CustomControlExample.main(CustomControlExample.java:54) I broke this when I was working on surrogate support. Fix http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=3e3d516dc75b4711bc2c5aa804a3940a7d89e620 thank you for the text case. Verified in I20111115-0800. |