Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 339138 - Text limit for Text widget doesn't work in some cases
Summary: Text limit for Text widget doesn't work in some cases
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.7   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: 3.7 RC1   Edit
Assignee: Lakshmi P Shanmugam CLA
QA Contact: Silenio Quarti CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-07 14:27 EST by Lakshmi P Shanmugam CLA
Modified: 2011-05-02 05:40 EDT (History)
1 user (show)

See Also:
Silenio_Quarti: review+


Attachments
patch (3.18 KB, patch)
2011-04-05 07:08 EDT, Lakshmi P Shanmugam CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lakshmi P Shanmugam CLA 2011-03-07 14:27:24 EST
Reproducible with Cocoa HEAD.

Came across this while working on a different Text bug.
Text.append(), insert(), paste() don't check for textlimit before changing the text.

Test snippet:

public static void main(String[] args) {
			Display display = new Display();
			Shell shell = new Shell(display);
			shell.setSize(200, 75);
			GridLayout layout = new GridLayout(1, false);
			shell.setLayout(layout);
			Text text = new Text(shell, SWT.BORDER|SWT.MULTI);
			text.setLayoutData(new GridData(GridData.FILL_BOTH));
			text.setTextLimit(6);
			text.setText("124");
			text.insert("456789");
			shell.open();
			while (!shell.isDisposed()) {
				if (!display.readAndDispatch())
					display.sleep();
			}
			display.dispose();
	}
Comment 1 Lakshmi P Shanmugam CLA 2011-04-05 07:08:24 EDT
Created attachment 192541 [details]
patch
Comment 2 Lakshmi P Shanmugam CLA 2011-04-19 06:14:36 EDT
Hi Silenio,
Can you please review for M7?
Comment 3 Silenio Quarti CLA 2011-04-26 10:32:52 EDT
Patch is good.
Comment 4 Lakshmi P Shanmugam CLA 2011-05-02 05:40:30 EDT
Fixed in HEAD > 20110502. 
Thanks Silenio.