Lines 14-19
Link Here
|
14 |
|
14 |
|
15 |
import java.util.ArrayList; |
15 |
import java.util.ArrayList; |
16 |
import java.util.List; |
16 |
import java.util.List; |
|
|
17 |
import java.util.Locale; |
17 |
|
18 |
|
18 |
import org.eclipse.swt.SWT; |
19 |
import org.eclipse.swt.SWT; |
19 |
import org.eclipse.swt.graphics.TextLayout; |
20 |
import org.eclipse.swt.graphics.TextLayout; |
Lines 117-122
Link Here
|
117 |
BidiEntry prevEntry = null, entry = null; |
118 |
BidiEntry prevEntry = null, entry = null; |
118 |
BidiInfo prevInfo = null, info = null; |
119 |
BidiInfo prevInfo = null, info = null; |
119 |
int end = 2, start = 0; |
120 |
int end = 2, start = 0; |
|
|
121 |
|
120 |
for (int i = 0; i < list.size(); i++) { |
122 |
for (int i = 0; i < list.size(); i++) { |
121 |
entry = (BidiEntry) list.get(i); |
123 |
entry = (BidiEntry) list.get(i); |
122 |
info = new BidiInfo(); |
124 |
info = new BidiInfo(); |
Lines 199-205
Link Here
|
199 |
return; |
201 |
return; |
200 |
char[] chars = new char[bidiText.length()]; |
202 |
char[] chars = new char[bidiText.length()]; |
201 |
bidiText.getChars(0, bidiText.length(), chars, 0); |
203 |
bidiText.getChars(0, bidiText.length(), chars, 0); |
202 |
|
|
|
203 |
if (orientation != SWT.RIGHT_TO_LEFT |
204 |
if (orientation != SWT.RIGHT_TO_LEFT |
204 |
&& !Bidi.requiresBidi(chars, 0, chars.length - 1)) |
205 |
&& !Bidi.requiresBidi(chars, 0, chars.length - 1)) |
205 |
return; |
206 |
return; |
Lines 210-217
Link Here
|
210 |
layout.setOrientation(orientation); |
211 |
layout.setOrientation(orientation); |
211 |
layout.setText(bidiText.toString()); |
212 |
layout.setText(bidiText.toString()); |
212 |
int j = 0, offset, prevLevel = -1; |
213 |
int j = 0, offset, prevLevel = -1; |
|
|
214 |
|
213 |
for (offset = 0; offset < chars.length; offset++) { |
215 |
for (offset = 0; offset < chars.length; offset++) { |
214 |
int newLevel = layout.getLevel(offset); |
216 |
int newLevel = layout.getLevel(offset); |
|
|
217 |
// Added to fix bug Bug 274567 |
218 |
if (Locale.getDefault().toString().toLowerCase() |
219 |
.contains("ar_") |
220 |
&& Character.isDigit(chars[offset]) |
221 |
&& newLevel == Bidi.MIXED |
222 |
&& (((orientation == SWT.LEFT_TO_RIGHT)) || (orientation == SWT.RIGHT_TO_LEFT && (Character |
223 |
.getDirectionality(chars[offset]) != Character.DIRECTIONALITY_LEFT_TO_RIGHT && (prevLevel == Bidi.RTL || prevLevel == 6))))) { |
224 |
newLevel = prevLevel == Bidi.RTL ? Character.DIRECTIONALITY_ARABIC_NUMBER |
225 |
: prevLevel; |
226 |
} |
227 |
|
215 |
if (newLevel != prevLevel) { |
228 |
if (newLevel != prevLevel) { |
216 |
if (j + 3 > levels.length) { |
229 |
if (j + 3 > levels.length) { |
217 |
int temp[] = levels; |
230 |
int temp[] = levels; |