diff options
author | Steve Northover <steve> | 2006-10-31 23:04:45 +0000 |
---|---|---|
committer | Steve Northover <steve> | 2006-10-31 23:04:45 +0000 |
commit | 1158171c465c5df6a7bdb8a8357ef67aade58db0 (patch) | |
tree | 1aadcde776585da8daf6219ddae1373d8c1251e5 | |
parent | 1f519f1819aba94c59a27c0ec7d3ced707bb3297 (diff) | |
download | eclipse.platform.swt-1158171c465c5df6a7bdb8a8357ef67aade58db0.tar.gz eclipse.platform.swt-1158171c465c5df6a7bdb8a8357ef67aade58db0.tar.xz eclipse.platform.swt-1158171c465c5df6a7bdb8a8357ef67aade58db0.zip |
fix EM_CHARFROMPOS to be unsigned
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java index f679443f2c..5f8b2e05d5 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Text.java @@ -420,9 +420,9 @@ boolean dragDetect (int hwnd, int x, int y, boolean filter, boolean [] detect, b if (filter) { int [] start = new int [1], end = new int [1]; OS.SendMessage (handle, OS.EM_GETSEL, start, end); - if (start [0] < end [0]) { + if (start [0] != end [0]) { int lParam = (x & 0xFFFF) | ((y << 16) & 0xFFFF0000); - int position = (short) (OS.SendMessage (handle, OS.EM_CHARFROMPOS, 0, lParam) & 0xFFFF); + int position = OS.SendMessage (handle, OS.EM_CHARFROMPOS, 0, lParam) & 0xFFFF; if (start [0] < position && position < end [0]) { if (super.dragDetect (hwnd, x, y, filter, detect, consume)) { if (consume != null) consume [0] = true; @@ -810,11 +810,14 @@ public int getOrientation () { * * @since 3.3 */ +//TODO - Javadoc /*public*/ int getPosition (Point point) { checkWidget(); if (point == null) error (SWT.ERROR_NULL_ARGUMENT); int lParam = (point.x & 0xFFFF) | ((point.y << 16) & 0xFFFF0000); - return OS.SendMessage (handle, OS.EM_CHARFROMPOS, 0, lParam) & 0xFFFF; + int position = OS.SendMessage (handle, OS.EM_CHARFROMPOS, 0, lParam) & 0xFFFF; + if (!OS.IsUnicode && OS.IsDBLocale) position = mbcsToWcsPos (position); + return position; } /** |