| Summary: | Ampersand is doubled on Link.getText() when link widget is not visible | ||
|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Albina Pace <albina.pace> |
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> |
| Status: | RESOLVED INVALID | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | albina.pace, ivan, stefan.roeck |
| Version: | 1.1 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
This problem does not exist in the latest version from CVS HEAD. Link widget was completely reworked recently. Ivan, does "recently" mean in 1.2 or in CVS Head? Thanks. "Recently" means CVS HEAD :-), but the bug does not exist in 1.2 release too (just checked). The snippet from the description works fine in 1.1.2 too. |
The ampersand (&) character is doubled when org.eclipse.swt.widgets.Link.getText() is called if the Link widget is not currently visible. Steps to reproduce: Use the following code which creates two tabs. The first tab contains link1, the second tab contains a button which displays link2 with the text of link1 when clicked. Actual Results: link2 contains a doubled ampersand i.e. "Test with &&" Expected Results: link2 contains "Test with &" Code snippet: TabFolder tabFolder = new TabFolder(parent, SWT.NONE); tabFolder.setLayout(new GridLayout(1, false)); tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); TabItem tab1 = new TabItem(tabFolder, SWT.NONE); tab1.setText("tab1"); Composite container1 = new Composite(tabFolder, SWT.NONE); container1.setLayout(new GridLayout(1, false)); container1.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); tab1.setControl(container1); final Link link1 = new Link(container1, SWT.NONE); link1.setText("Test with &"); TabItem tab2 = new TabItem(tabFolder, SWT.NONE); tab2.setText("tab2"); Composite container2 = new Composite(tabFolder, SWT.NONE); container2.setLayout(new GridLayout(2, false)); container2.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); tab2.setControl(container2); final Link link2 = new Link(container2, SWT.NONE); Button button = new Button(container2, SWT.NONE); button.setText("press to set text"); button.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent e) { link2.setText(link1.getText()); } });