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

Bug 355524

Summary: StyledText: Horizontal scrollbar is not reset when calling setText(String)
Product: [Eclipse Project] Platform Reporter: Nam Quang Tran <qforce>
Component: SWTAssignee: Felipe Heidrich <eclipse.felipe>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipse.felipe
Version: 4.2   
Target Milestone: 3.8 M2   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
StyledText with clear button none

Description Nam Quang Tran CLA 2011-08-23 11:10:52 EDT
Build Identifier: 

When the StyledText displays a horizontal scrollbar and the text is cleared by calling StyledText.setText(""), the horizontal scrollbar is not updated. However, this problem does not occur when the text is cleared by manually selecting and deleting the text.

Reproducible: Always

Steps to Reproduce:
1) Run the attached snippet and click on the 'Clear' button. Result: The horizontal scrollbar is not reset correctly, but the vertical scrollbar is.

2) Re-run the snippet, delete all text by pressing Ctrl+A, then Delete key. Result: Both scrollbars are reset correctly.
Comment 1 Nam Quang Tran CLA 2011-08-23 11:11:56 EDT
Created attachment 202009 [details]
StyledText with clear button
Comment 2 Nam Quang Tran CLA 2011-08-23 11:15:41 EDT
This was tested against SWT 3.7.