Community
Participate
Working Groups
Build Identifier: M20100211-1343 A call to method setOrientation(SWT.RIGHT_TO_LEFT) of an instance i of StyledText does not change the TextOrientation (as it, for example, does in the Windows version). First of all, the behavior of the widget does not change. Secondly a call to getOrientation always returns SWT.LEFT_TO_RIGHT, even after a call to setOrientation(SWT.RIGHT_TO_LEFT). Looking at the source it's my impression that: i) isMirrored is set once in the constructor ii) the only other write access to isMirrored is in setOrientation iii) in setOrientation with RIGHT_TO_LEFT the comparison if ((orientation & SWT.LEFT_TO_RIGHT) != 0 && !isMirrored()) { return; } is always executed with the initial setting of isMirrored and therefore always true -> the method never reaches the line where isMirrored would be changed. Moreover, !BidiUtil.setOrientation(...) is also always true. Reproducible: Always Steps to Reproduce: 1.Create an SWT based application with a StyledText instance x. Add a button or some similar control and call setOrientation(SWT.RIGHT_TO_LEFT) when button is pressed. 2.run the application and press the button. Feed the result of a call to x.getOrientation() to System.err before and after pressing the button... 3.enter some text in the StyledText to see it's still left adjusted...
setOrientation() is a hint and only works on Windows.
Fixed in HEAD.