Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 192296 Details for
Bug 339090
Bidi: Consistent support of Arabic-Indic digits and Numeric contextual behavior in Eclipse projects
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed patch
339090.txt (text/plain), 4.31 KB, created by
Dina Sayed
on 2011-03-31 11:49:40 EDT
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Dina Sayed
Created:
2011-03-31 11:49:40 EDT
Size:
4.31 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.swt >Index: Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java,v >retrieving revision 1.186 >diff -u -r1.186 TextLayout.java >--- Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java 8 Nov 2010 19:22:59 -0000 1.186 >+++ Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java 31 Mar 2011 15:37:06 -0000 >@@ -1625,6 +1625,26 @@ > end = Math.min(Math.max(0, end), length - 1); > start = translateOffset(start); > end = translateOffset(end); >+ /* use the high surrogate for the start offset and the low surrogate for the end offset */ >+ length = segmentsText.length(); >+ char ch = segmentsText.charAt(start); >+ if (0xDC00 <= ch && ch <= 0xDFFF) { >+ if (start - 1 >= 0) { >+ ch = segmentsText.charAt(start - 1); >+ if (0xD800 <= ch && ch <= 0xDBFF) { >+ start--; >+ } >+ } >+ } >+ ch = segmentsText.charAt(end); >+ if (0xD800 <= ch && ch <= 0xDBFF) { >+ if (end + 1 < length) { >+ ch = segmentsText.charAt(end + 1); >+ if (0xDC00 <= ch && ch <= 0xDFFF) { >+ end++; >+ } >+ } >+ } > int left = 0x7fffffff, right = 0; > int top = 0x7fffffff, bottom = 0; > boolean isRTL = (orientation & SWT.RIGHT_TO_LEFT) != 0; >@@ -1983,6 +2003,27 @@ > if (offset == length) { > return new Point(getLineIndent(line) + lineWidth[line], lineY[line]); > } >+ /* For trailing use the low surrogate and for lead use the high surrogate */ >+ char ch = segmentsText.charAt(offset); >+ if (trailing) { >+ if (0xD800 <= ch && ch <= 0xDBFF) { >+ if (offset + 1 < length) { >+ ch = segmentsText.charAt(offset + 1); >+ if (0xDC00 <= ch && ch <= 0xDFFF) { >+ offset++; >+ } >+ } >+ } >+ } else { >+ if (0xDC00 <= ch && ch <= 0xDFFF) { >+ if (offset - 1 >= 0) { >+ ch = segmentsText.charAt(offset - 1); >+ if (0xD800 <= ch && ch <= 0xDBFF) { >+ offset--; >+ } >+ } >+ } >+ } > int low = -1; > int high = allRuns.length; > while (high - low > 1) { >@@ -2066,9 +2107,16 @@ > } > switch (movement) { > case SWT.MOVEMENT_CLUSTER: { >- if (properties.fNeedsCaretInfo) { >- if (!logAttr.fInvalid && logAttr.fCharStop) return untranslateOffset(offset); >- } else { >+ if (!properties.fNeedsCaretInfo || (!logAttr.fInvalid && logAttr.fCharStop)) { >+ char ch = segmentsText.charAt(offset); >+ if (0xDC00 <= ch && ch <= 0xDFFF) { >+ if (offset > 0) { >+ ch = segmentsText.charAt(offset - 1); >+ if (0xD800 <= ch && ch <= 0xDBFF) { >+ offset += step; >+ } >+ } >+ } > return untranslateOffset(offset); > } > break; >@@ -2209,8 +2257,28 @@ > } > int /*long*/ advances = run.justify != 0 ? run.justify : run.advances; > OS.ScriptXtoCP(xRun, cChars, cGlyphs, run.clusters, run.visAttrs, advances, run.analysis, piCP, piTrailing); >- if (trailing != null) trailing[0] = piTrailing[0]; >- return untranslateOffset(run.start + piCP[0]); >+ int offset = run.start + piCP[0]; >+ char ch = segmentsText.charAt(offset); >+ int length = segmentsText.length(); >+ if (0xD800 <= ch && ch <= 0xDBFF) { >+ if (offset + 1 < length) { >+ ch = segmentsText.charAt(offset + 1); >+ if (0xDC00 <= ch && ch <= 0xDFFF) { >+ if (trailing != null) trailing[0] = 0; >+ } >+ } >+ } else if (0xDC00 <= ch && ch <= 0xDFFF) { >+ if (offset - 1 >= 0) { >+ ch = segmentsText.charAt(offset - 1); >+ if (0xD800 <= ch && ch <= 0xDBFF) { >+ offset--; >+ if (trailing != null) trailing[0] = 2; >+ } >+ } >+ } else { >+ if (trailing != null) trailing[0] = piTrailing[0]; >+ } >+ return untranslateOffset(offset); > } > } > if (trailing != null) trailing[0] = 0; >@@ -2514,6 +2582,20 @@ > return device == null; > } > >+ >+/* >+ * if the digit substitution selected is contextual return true, otherwise return false >+ */ >+ >+public boolean isContextDigitSubistitution(){ >+ >+ SCRIPT_DIGITSUBSTITUTE scriptDigitSubistitue= new SCRIPT_DIGITSUBSTITUTE(); >+ OS.ScriptRecordDigitSubstitution(OS.LOCALE_USER_DEFAULT,scriptDigitSubistitue); >+ if(scriptDigitSubistitue.DigitSubstitute==0) >+ return true; >+ return false; >+} >+ > /* > * Itemize the receiver text > */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 339090
:
191962
| 192296