Mercurial > projects > dwt-win
changeset 252:dffb802cad03
Fix: StyledText.paste() to check for empty clipboard result.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 06 Jul 2008 18:45:41 +0200 |
parents | f6169caa2e05 |
children | fbb9174f2a2c |
files | dwt/custom/StyledText.d |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/dwt/custom/StyledText.d Sun Jul 06 17:34:59 2008 +0200 +++ b/dwt/custom/StyledText.d Sun Jul 06 18:45:41 2008 +0200 @@ -6038,7 +6038,10 @@ */ public void paste(){ checkWidget(); - String text = (cast(ArrayWrapperString) getClipboardContent(DND.CLIPBOARD)).array; + String text = null; + if( auto o = cast(ArrayWrapperString) getClipboardContent(DND.CLIPBOARD)){ + text = o.array; + } if (text !is null && text.length > 0) { Event event = new Event(); event.start = selection.x;