summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextRenderer.java
diff options
context:
space:
mode:
authorFelipe Heidrich <fheidric>2008-10-16 19:45:02 +0000
committerFelipe Heidrich <fheidric>2008-10-16 19:45:02 +0000
commitb0b4d30a7cd73687715ad49dd2748b10070ab40c (patch)
tree0c39eddca800a5d3948c9b964e2f75b7ed3c0385 /bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextRenderer.java
parent6e3fbd94b2c15273a851786f1a5dbf4d3548ba4f (diff)
downloadeclipse.platform.swt-b0b4d30a7cd73687715ad49dd2748b10070ab40c.tar.gz
eclipse.platform.swt-b0b4d30a7cd73687715ad49dd2748b10070ab40c.tar.xz
eclipse.platform.swt-b0b4d30a7cd73687715ad49dd2748b10070ab40c.zip
Bug 251089 - StyledText#copy() fails in RTFWriter with AIOOBE
note: this bug was originally fixed by the new fix for Bug 212851 date 20081016
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledTextRenderer.java')
-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) {