summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti <silenio_quarti@ca.ibm.com>2012-07-24 10:58:49 -0400
committerSilenio Quarti <silenio_quarti@ca.ibm.com>2012-07-24 10:58:49 -0400
commit27680729acd44e890a7f12853debc377384d8bbf (patch)
tree82b181390eed4fd75c8b7541f00af8df8284d34c
parenta7e61736e1095cbe786bcaff8388454622dd1bc9 (diff)
downloadeclipse.platform.swt-27680729acd44e890a7f12853debc377384d8bbf.tar.gz
eclipse.platform.swt-27680729acd44e890a7f12853debc377384d8bbf.tar.xz
eclipse.platform.swt-27680729acd44e890a7f12853debc377384d8bbf.zip
Bug 385570 - [DBCS4.2] wrong selection by using a mouse toward a character of Unicode surrogate pair at end of line
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java
index 0619c69f1b..3816b1273a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/TextLayout.java
@@ -2268,14 +2268,14 @@ public int getOffset (int x, int y, int[] trailing) {
int offset = run.start + piCP[0];
int length = segmentsText.length();
char ch = offset < length ? segmentsText.charAt(offset) : 0;
- if (0xD800 <= ch && ch <= 0xDBFF) {
+ if (0xD800 <= ch && ch <= 0xDBFF && piTrailing[0] <= 1) {
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) {
+ } else if (0xDC00 <= ch && ch <= 0xDFFF && piTrailing[0] <= 1) {
if (offset - 1 >= 0) {
ch = segmentsText.charAt(offset - 1);
if (0xD800 <= ch && ch <= 0xDBFF) {