summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorRaymond Lam2012-01-13 15:17:56 (EST)
committer Felipe Heidrich2012-01-13 16:02:29 (EST)
commit9d4061daafc695514476ce33dd01c3ee3d9c6368 (patch)
treef0bb0dd0a3d5ecd44cde5318bfbc0ff8b0dea4ba
parent99429d6dcd838b8ee5cda3dbd63fdc77a1df49e1 (diff)
downloadeclipse.platform.swt-9d4061daafc695514476ce33dd01c3ee3d9c6368.zip
eclipse.platform.swt-9d4061daafc695514476ce33dd01c3ee3d9c6368.tar.gz
eclipse.platform.swt-9d4061daafc695514476ce33dd01c3ee3d9c6368.tar.bz2
Fix StringIndexOutOfBoundsException in Link Widget.
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java
index 0948507..38486f0 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Link.java
@@ -264,7 +264,7 @@ void drawBufferredTextRun(int /*long*/ targetDC, String parsedText, int runStart
boolean underline = false;
TextStyle style = layout.getStyle(runStart);
if (style != null) {
- color = (style.foreground.getBlue() << 16) + (style.foreground.getGreen() << 8) + style.foreground.getRed();
+ color = style.foreground.handle;
underline = style.underline;
}
@@ -1109,7 +1109,7 @@ LRESULT wmBufferedPaint (int /*long*/ hWnd, int /*long*/ wParam, int /*long*/ lP
int runEnd = (i < styleOffsets.length) ? styleOffsets[i] : parsedText.length();
// skip leading whitespace characters since the lineOffsets from TextLayout have already done likewise
- while(Character.isWhitespace(parsedText.charAt(runStart)) && runStart < runEnd) {
+ while(runStart < runEnd && Character.isWhitespace(parsedText.charAt(runStart))) {
runStart++;
}