changeset 258:0389eeb717f8

fix: corrupted string content in DnD RTF
author Frank Benoit <benoit@tionex.de>
date Sun, 06 Jul 2008 14:12:31 +0200
parents cc1d3de0e80b
children 58ef057b3e9d
files dwt/dnd/RTFTransfer.d
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/dwt/dnd/RTFTransfer.d	Tue Jun 24 22:12:18 2008 +0200
+++ b/dwt/dnd/RTFTransfer.d	Sun Jul 06 14:12:31 2008 +0200
@@ -101,9 +101,8 @@
     if ( !isSupportedType(transferData) ||  transferData.pValue is null ) return null;
     int size = transferData.format * transferData.length / 8;
     if (size is 0) return null;
-    byte[] buffer = new byte[size];
     char [] chars = transferData.pValue[ 0 .. size];
-    return new ArrayWrapperString( chars[ 0 .. tango.text.Util.locate( chars, '\0' ) ] );
+    return new ArrayWrapperString( chars[ 0 .. tango.text.Util.locate( chars, '\0' ) ].dup );
 }
 
 protected override int[] getTypeIds() {