Bug 562271

Summary: Windows: Pasting Non-Empty text onto SWT.MULTI-Text widget causes 2 events (first one with "")
Product: [Eclipse Project] Platform Reporter: Ingo Mohr <tellastory73>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 4.15   
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
Whiteboard:

Description Ingo Mohr CLA 2020-04-17 14:32:46 EDT
Hi folks! :)

This just took me 2h of debugging in our own client code base, and what I found in the end seems to be a bug in SWT.

Scenario
--------
* Have a Text widget with style: SWT.BORDER | SWT.MULTI
* Enter some text A
* Copy some other text B to clipboard
* Select A and hit Paste (CTRL + V)

Expected
--------
* 1 Event: Text widget has value B

Actual
------
* 2 Events:
** 1: Text widget has value ""
** 2: Text widget has value B

Main Problem (for us) this effect causes is performing UNDO:
* Undoing the change clears the value.
* You have to undo twice to get back to the old value.


Note:
For single line Text widgets - i.e. a Text with style SWT.BORDER (without SWT.MULTI), the scenario works as expected.

Thanks in advance for looking at it. :)

Cheers
Ingo