summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextRenderer.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextRenderer.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextRenderer.java
index bb86d5e2a2..521228af6c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextRenderer.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextRenderer.java
@@ -567,6 +567,7 @@ int getRangeIndex(int offset, int low, int high) {
return high;
}
int[] getRanges(int start, int length) {
+ if (length == 0) return null;
int[] newRanges;
int end = start + length - 1;
if (ranges != null) {
@@ -600,6 +601,7 @@ int[] getRanges(int start, int length) {
return newRanges;
}
StyleRange[] getStyleRanges(int start, int length, boolean includeRanges) {
+ if (length == 0) return null;
StyleRange[] newStyles;
int end = start + length - 1;
if (ranges != null) {