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

Bug 128750

Summary: Error occurs when delete text in StyledText
Product: [Eclipse Project] Platform Reporter: Luma <maruojie>
Component: SWTAssignee: Felipe Heidrich <eclipse.felipe>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: alexberns
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Attachment 1
none
Attachment 2
none
Attachment 3 (log file) none

Description Luma CLA 2006-02-21 01:08:53 EST
First, run Snippet 212, whose URL is http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet212.java?rev=HEAD&content-type=text/vnd.viewcvs-markup

Then, resize the shell. Make it being smaller than its content height, please see attachment 1 [details]

Then, press Shift + Down Arrow to select all text, please see attachment 2 [details]

Then, press Backspace, an error will occur. The log is uploaded as attachment 3 [details]
Comment 1 Luma CLA 2006-02-21 01:10:05 EST
Created attachment 35042 [details]
Attachment 1 [details]
Comment 2 Luma CLA 2006-02-21 01:10:57 EST
Created attachment 35043 [details]
Attachment 2 [details]
Comment 3 Luma CLA 2006-02-21 01:11:39 EST
Created attachment 35044 [details]
Attachment 3 [details] (log file)
Comment 4 Veronika Irvine CLA 2006-02-21 10:39:05 EST
I am not sure about the files you have attatched.  They show a JDT editor error which is unrelated to Snippet212.

When I follow the steps in your description, I get the following error:

java.lang.IllegalArgumentException: Argument not valid
	at org.eclipse.swt.SWT.error(SWT.java:3333)
	at org.eclipse.swt.SWT.error(SWT.java:3272)
	at org.eclipse.swt.SWT.error(SWT.java:3243)
	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:727)
	at org.eclipse.swt.custom.StyledTextRenderer.getTextLayout(StyledTextRenderer.java:673)
	at org.eclipse.swt.custom.StyledTextRenderer.calculate(StyledTextRenderer.java:200)
	at org.eclipse.swt.custom.StyledTextRenderer.getLineHeight(StyledTextRenderer.java:539)
	at org.eclipse.swt.custom.StyledText.getLineIndex(StyledText.java:3644)
	at org.eclipse.swt.custom.StyledText.getPartialBottomIndex(StyledText.java:3836)
	at org.eclipse.swt.custom.StyledText.claimBottomFreeSpace(StyledText.java:1557)
	at org.eclipse.swt.custom.StyledText.handleTextChanged(StyledText.java:5307)
	at org.eclipse.swt.custom.StyledText$6.textChanged(StyledText.java:4783)
	at org.eclipse.swt.custom.StyledTextListener.handleEvent(StyledTextListener.java:66)
	at org.eclipse.swt.custom.DefaultContent.sendTextEvent(DefaultContent.java:794)
	at org.eclipse.swt.custom.DefaultContent.replaceTextRange(DefaultContent.java:787)
	at org.eclipse.swt.custom.StyledText.modifyContent(StyledText.java:5755)
	at org.eclipse.swt.custom.StyledText.sendKeyEvent(StyledText.java:6466)
	at org.eclipse.swt.custom.StyledText.doBackspace(StyledText.java:2028)
	at org.eclipse.swt.custom.StyledText.invokeAction(StyledText.java:5641)
	at org.eclipse.swt.custom.StyledText.handleKey(StyledText.java:5043)
	at org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:5065)
	at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:4804)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:925)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:949)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:934)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:962)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:958)
	at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1272)
	at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3336)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:3236)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:3965)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1802)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2905)
	at org.eclipse.swt.snippets.Snippet212.main(Snippet212.java:142)
Comment 5 Luma CLA 2006-02-21 19:55:56 EST
Yes, that's the problem, you got it.

I really don't know bugzilla will show my input as a link, so please don't bother with them. 

The correct attachment is:
https://bugs.eclipse.org/bugs/attachment.cgi?id=35042
https://bugs.eclipse.org/bugs/attachment.cgi?id=35043
https://bugs.eclipse.org/bugs/attachment.cgi?id=35044
Comment 6 Felipe Heidrich CLA 2006-02-22 11:21:52 EST
I think this is a duplicated of bug 122379
Comment 7 Felipe Heidrich CLA 2006-03-17 15:26:21 EST
fixed in HEAD > 20060317

please verify
Comment 8 Felipe Heidrich CLA 2006-03-17 15:26:41 EST
.
Comment 9 Felipe Heidrich CLA 2006-04-11 15:21:18 EDT
*** Bug 134158 has been marked as a duplicate of this bug. ***