Mercurial > projects > dwt-mac
comparison dwt/custom/StyleRange.d @ 154:535243e6d16a
Fixes to make dwt compile with ldc
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Sat, 13 Jun 2009 00:25:05 +0200 |
parents | 6337764516f1 |
children |
comparison
equal
deleted
inserted
replaced
153:8433dabeb15e | 154:535243e6d16a |
---|---|
199 * | 199 * |
200 * @return a string representation of the StyleRange | 200 * @return a string representation of the StyleRange |
201 */ | 201 */ |
202 public override String toString() { | 202 public override String toString() { |
203 StringBuffer buffer = new StringBuffer(); | 203 StringBuffer buffer = new StringBuffer(); |
204 buffer.append("StyleRange {"); | 204 buffer.format("{}", "StyleRange {"); |
205 buffer.append(start); | 205 buffer.format("{}", start); |
206 buffer.append(", "); | 206 buffer.format("{}", ", "); |
207 buffer.append(length); | 207 buffer.format("{}", length); |
208 buffer.append(", fontStyle="); | 208 buffer.format("{}", ", fontStyle="); |
209 switch (fontStyle) { | 209 switch (fontStyle) { |
210 case DWT.BOLD: | 210 case DWT.BOLD: |
211 buffer.append("bold"); | 211 buffer.format("{}", "bold"); |
212 break; | 212 break; |
213 case DWT.ITALIC: | 213 case DWT.ITALIC: |
214 buffer.append("italic"); | 214 buffer.format("{}", "italic"); |
215 break; | 215 break; |
216 case DWT.BOLD | DWT.ITALIC: | 216 case DWT.BOLD | DWT.ITALIC: |
217 buffer.append("bold-italic"); | 217 buffer.format("{}", "bold-italic"); |
218 break; | 218 break; |
219 default: | 219 default: |
220 buffer.append("normal"); | 220 buffer.format("{}", "normal"); |
221 } | 221 } |
222 String str = super.toString(); | 222 String str = super.toString(); |
223 int index = tango.text.Util.locate( str, '{'); | 223 int index = tango.text.Util.locate( str, '{'); |
224 if( index is str.length ) index = -1; | 224 if( index is str.length ) index = -1; |
225 str = str[ index + 1 .. $ ]; | 225 str = str[ index + 1 .. $ ]; |
226 if (str.length > 1) buffer.append(", "); | 226 if (str.length > 1) buffer.format("{}", ", "); |
227 buffer.append(str); | 227 buffer.format("{}", str); |
228 return buffer.toString(); | 228 return buffer.toString(); |
229 } | 229 } |
230 } | 230 } |