diff options
author | Felipe Heidrich <fheidric> | 2006-03-17 20:24:10 +0000 |
---|---|---|
committer | Felipe Heidrich <fheidric> | 2006-03-17 20:24:10 +0000 |
commit | f6d78f0591c45ef25c8420afec7784a94dcab9b9 (patch) | |
tree | 8ca6f34096f4c25260f9720cd31ee6daf11f8496 | |
parent | 1706467ec4eed7bb7794d11ff64da0adee8b3249 (diff) | |
download | eclipse.platform.swt-f6d78f0591c45ef25c8420afec7784a94dcab9b9.tar.gz eclipse.platform.swt-f6d78f0591c45ef25c8420afec7784a94dcab9b9.tar.xz eclipse.platform.swt-f6d78f0591c45ef25c8420afec7784a94dcab9b9.zip |
128750 Error occurs when delete text in StyledText
122379 SWTException when deleting text from StyledText, if selection larger than visible part
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java | 20 |
1 files changed, 12 insertions, 8 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 de13e1620c..6bee48de56 100755 --- 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 @@ -1548,8 +1548,6 @@ void claimBottomFreeSpace() { int lineHeight = renderer.getLineHeight(); int newVerticalOffset = Math.max(0, content.getLineCount() * lineHeight - clientAreaHeight); if (newVerticalOffset < getVerticalScrollOffset()) { - // Scroll up so that empty lines below last text line are used. - // Fixes 1GEYJM0 scrollVertical(newVerticalOffset - getVerticalScrollOffset(), true); } } else { @@ -5291,12 +5289,18 @@ void handleResize(Event event) { void handleTextChanged(TextChangedEvent event) { int firstLine = content.getLineAtOffset(lastTextChangeStart); resetCache(firstLine, 0); - int lastLine = firstLine + lastTextChangeNewLineCount; - int firstLineTop = getLinePixel(firstLine); - int newLastLineBottom = getLinePixel(lastLine + 1); - scrollText(lastLineBottom, newLastLineBottom); - super.redraw(0, firstLineTop, clientAreaWidth, newLastLineBottom - firstLineTop, false); - redrawLinesBullet(renderer.redrawLines); + if (!isFixedLineHeight() && topIndex > firstLine) { + topIndex = firstLine; + topIndexY = 0; + super.redraw(); + } else { + int lastLine = firstLine + lastTextChangeNewLineCount; + int firstLineTop = getLinePixel(firstLine); + int newLastLineBottom = getLinePixel(lastLine + 1); + scrollText(lastLineBottom, newLastLineBottom); + super.redraw(0, firstLineTop, clientAreaWidth, newLastLineBottom - firstLineTop, false); + redrawLinesBullet(renderer.redrawLines); + } renderer.redrawLines = null; // update selection/caret location after styles have been changed. // otherwise any text measuring could be incorrect |