Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 122379

Summary: SWTException when deleting text from StyledText, if selection larger than visible part
Product: [Eclipse Project] Platform Reporter: Heinke <e-bug>
Component: SWTAssignee: Felipe Heidrich <eclipse.felipe>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3    
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Javaclass which exhibits problem none

Description Heinke CLA 2005-12-30 05:38:23 EST
If you attempt to delete selected text in a StyledText widget, where the selection extends beyond the visible windowarea, you get an SWTException:

Caused by: java.lang.IllegalArgumentException: Argument not valid
        at org.eclipse.swt.SWT.error(SWT.java:3267)
        at org.eclipse.swt.SWT.error(SWT.java:3206)
        at org.eclipse.swt.SWT.error(SWT.java:3177)
        at org.eclipse.swt.custom.DefaultContent.error(DefaultContent.java:670)
        at org.eclipse.swt.custom.DefaultContent.getLine(DefaultContent.java:478)
        at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:643)
        at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:607)
        at org.eclipse.swt.custom.StyledTextRenderer.calculate(StyledTextRenderer.java:197)
        at org.eclipse.swt.custom.StyledText.getVerticalScrollOffset(StyledText.java:4547)
        at org.eclipse.swt.custom.StyledTextRenderer$1.run(StyledTextRenderer.java:240)
        at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
        at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
Comment 1 Heinke CLA 2005-12-30 08:03:31 EST
Created attachment 32352 [details]
Javaclass which exhibits problem

If the StyledText does not have the Style SWT.WRAP the exception does not happen
Comment 2 Felipe Heidrich CLA 2006-03-17 15:27:59 EST
fixed in HEAD > 20060317

please verify
Comment 3 Heinke CLA 2006-04-26 06:05:07 EDT
(In reply to comment #2)
> fixed in HEAD > 20060317
> 
> please verify
> 
Verified. Thank you