Mercurial > projects > dwt-linux
comparison dwt/custom/StyleRange.d @ 238:380bad9f6852
reverted char[] to String
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 05 May 2008 00:42:55 +0200 |
parents | cd8dc3f19679 |
children | ce446666f5a2 |
comparison
equal
deleted
inserted
replaced
237:98b80b00af79 | 238:380bad9f6852 |
---|---|
9 * IBM Corporation - initial API and implementation | 9 * IBM Corporation - initial API and implementation |
10 * Port to the D programming language: | 10 * Port to the D programming language: |
11 * Frank Benoit <benoit@tionex.de> | 11 * Frank Benoit <benoit@tionex.de> |
12 *******************************************************************************/ | 12 *******************************************************************************/ |
13 module dwt.custom.StyleRange; | 13 module dwt.custom.StyleRange; |
14 | |
15 import dwt.dwthelper.utils; | |
14 | 16 |
15 | 17 |
16 import dwt.DWT; | 18 import dwt.DWT; |
17 import dwt.graphics.Color; | 19 import dwt.graphics.Color; |
18 import dwt.graphics.TextStyle; | 20 import dwt.graphics.TextStyle; |
173 * Returns a string containing a concise, human-readable | 175 * Returns a string containing a concise, human-readable |
174 * description of the receiver. | 176 * description of the receiver. |
175 * | 177 * |
176 * @return a string representation of the StyleRange | 178 * @return a string representation of the StyleRange |
177 */ | 179 */ |
178 public override char[] toString() { | 180 public override String toString() { |
179 StringBuffer buffer = new StringBuffer(); | 181 StringBuffer buffer = new StringBuffer(); |
180 buffer.append("StyleRange {"); | 182 buffer.append("StyleRange {"); |
181 buffer.append(start); | 183 buffer.append(start); |
182 buffer.append(", "); | 184 buffer.append(", "); |
183 buffer.append(length); | 185 buffer.append(length); |
193 buffer.append("bold-italic"); | 195 buffer.append("bold-italic"); |
194 break; | 196 break; |
195 default: | 197 default: |
196 buffer.append("normal"); | 198 buffer.append("normal"); |
197 } | 199 } |
198 char[] str = super.toString(); | 200 String str = super.toString(); |
199 int index = tango.text.Util.locate( str, '{'); | 201 int index = tango.text.Util.locate( str, '{'); |
200 if( index is str.length ) index = -1; | 202 if( index is str.length ) index = -1; |
201 str = str[ index + 1 .. $ ]; | 203 str = str[ index + 1 .. $ ]; |
202 if (str.length > 1) buffer.append(", "); | 204 if (str.length > 1) buffer.append(", "); |
203 buffer.append(str); | 205 buffer.append(str); |