Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(740)

Unified Diff: pkg/intl/lib/bidi_utils.dart

Issue 12382036: Fix deprecated StringBuffer usages in Intl (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/intl/lib/date_format.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/intl/lib/bidi_utils.dart
diff --git a/pkg/intl/lib/bidi_utils.dart b/pkg/intl/lib/bidi_utils.dart
index 35d62b729fd78ea9575ce3c3a6875b8b513a9370..e4599dabda8ff5c14acd3209cb7377db212dcffd 100644
--- a/pkg/intl/lib/bidi_utils.dart
+++ b/pkg/intl/lib/bidi_utils.dart
@@ -244,11 +244,11 @@ class Bidi {
var startIndex = 0;
Match match = new RegExp('<\\w+').firstMatch(html);
if (match != null) {
- buffer..add(html.substring(startIndex, match.end))
- ..add(' dir=$direction');
+ buffer..write(html.substring(startIndex, match.end))
+ ..write(' dir=$direction');
startIndex = match.end;
}
- return (buffer..add(html.substring(startIndex))).toString();
+ return (buffer..write(html.substring(startIndex))).toString();
}
// '\n' is important for FF so that it won't incorrectly merge span groups.
return '\n<span dir=$direction>$html</span>';
@@ -298,13 +298,13 @@ class Bidi {
var startIndex = 0;
Iterable matches = regexp.allMatches(str);
for (Match match in matches) {
- buffer..add(str.substring(startIndex, match.start))
- ..add(before)
- ..add(str.substring(match.start, match.end))
- ..add(after);
+ buffer..write(str.substring(startIndex, match.start))
+ ..write(before)
+ ..write(str.substring(match.start, match.end))
+ ..write(after);
startIndex = match.end;
}
- return (buffer..add(str.substring(startIndex))).toString();
+ return (buffer..write(str.substring(startIndex))).toString();
}
/**
@@ -359,19 +359,19 @@ class Bidi {
static String normalizeHebrewQuote(String str) {
StringBuffer buf = new StringBuffer();
if (str.length > 0) {
- buf.add(str.substring(0, 1));
+ buf.write(str.substring(0, 1));
}
// Start at 1 because we're looking for the patterns [\u0591-\u05f2])" or
// [\u0591-\u05f2]'.
for (int i = 1; i < str.length; i++) {
if (str.substring(i, i+1) == '"'
&& new RegExp('[\u0591-\u05f2]').hasMatch(str.substring(i-1, i))) {
- buf.add('\u05f4');
+ buf.write('\u05f4');
} else if (str.substring(i, i+1) == "'"
&& new RegExp('[\u0591-\u05f2]').hasMatch(str.substring(i-1, i))) {
- buf.add('\u05f3');
+ buf.write('\u05f3');
} else {
- buf.add(str.substring(i, i+1));
+ buf.write(str.substring(i, i+1));
}
}
return buf.toString();
« no previous file with comments | « no previous file | pkg/intl/lib/date_format.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698