Mercurial > projects > dwt-linux
comparison dwt/dnd/RTFTransfer.d @ 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 | 380bad9f6852 |
children | 58ef057b3e9d |
comparison
equal
deleted
inserted
replaced
257:cc1d3de0e80b | 258:0389eeb717f8 |
---|---|
99 */ | 99 */ |
100 public override Object nativeToJava(TransferData transferData){ | 100 public override Object nativeToJava(TransferData transferData){ |
101 if ( !isSupportedType(transferData) || transferData.pValue is null ) return null; | 101 if ( !isSupportedType(transferData) || transferData.pValue is null ) return null; |
102 int size = transferData.format * transferData.length / 8; | 102 int size = transferData.format * transferData.length / 8; |
103 if (size is 0) return null; | 103 if (size is 0) return null; |
104 byte[] buffer = new byte[size]; | |
105 char [] chars = transferData.pValue[ 0 .. size]; | 104 char [] chars = transferData.pValue[ 0 .. size]; |
106 return new ArrayWrapperString( chars[ 0 .. tango.text.Util.locate( chars, '\0' ) ] ); | 105 return new ArrayWrapperString( chars[ 0 .. tango.text.Util.locate( chars, '\0' ) ].dup ); |
107 } | 106 } |
108 | 107 |
109 protected override int[] getTypeIds() { | 108 protected override int[] getTypeIds() { |
110 return [TEXT_RTF_ID, TEXT_RTF2_ID, APPLICATION_RTF_ID]; | 109 return [TEXT_RTF_ID, TEXT_RTF2_ID, APPLICATION_RTF_ID]; |
111 } | 110 } |