diff options
author | Niraj Modi | 2016-05-03 14:32:19 +0000 |
---|---|---|
committer | Niraj Modi | 2016-05-06 12:35:04 +0000 |
commit | 53a1a379664b562e9aecebb64a52f95d96029227 (patch) | |
tree | 3967deaaa6dad687676b17fd9bb6d3d019b23ac1 | |
parent | 6c57834c58239a93119a59d25acd62a9c9045fd7 (diff) | |
download | eclipse.platform.swt-53a1a379664b562e9aecebb64a52f95d96029227.tar.gz eclipse.platform.swt-53a1a379664b562e9aecebb64a52f95d96029227.tar.xz eclipse.platform.swt-53a1a379664b562e9aecebb64a52f95d96029227.zip |
Bug 452141 - IllegalArgumentException in TextLayout._getOffset
(IME.WM_IME_COMPOSITION)
Change-Id: I3fbac8e1c218abf0021886fd7b67a857fdd04c4f
Signed-off-by: Niraj Modi <niraj.modi@in.ibm.com>
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java index 3298aa831e..9a0aaf5079 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java @@ -3694,8 +3694,8 @@ Rectangle getBoundsAtOffset(int offset) { String line = content.getLine(lineIndex); Rectangle bounds; if (line.length() != 0) { - int offsetInLine = Math.max (0, offset - lineOffset); TextLayout layout = renderer.getTextLayout(lineIndex); + int offsetInLine = Math.min (layout.getText().length(), Math.max (0, offset - lineOffset)); if (caretAlignment == PREVIOUS_OFFSET_TRAILING && offsetInLine != 0) { offsetInLine = layout.getPreviousOffset(offsetInLine, SWT.MOVEMENT_CLUSTER); Point point = layout.getLocation(offsetInLine, true); |