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

Unified Diff: lib/i18n/bidi_formatter.dart

Issue 10703030: Get rid of BidiUtils as a class holding only static methods. I was reminded by (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 | lib/i18n/bidi_utils.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/i18n/bidi_formatter.dart
===================================================================
--- lib/i18n/bidi_formatter.dart (revision 9206)
+++ lib/i18n/bidi_formatter.dart (working copy)
@@ -76,7 +76,7 @@
BidiFormatter.UNKNOWN([alwaysSpan=false]) :
contextDirection = TextDirection.UNKNOWN, _alwaysSpan = alwaysSpan;
- /** Is true if the context direction for this formatter is RTL. */
+ /** Is true if the known context direction for this formatter is RTL. */
bool get isRTL() => contextDirection == TextDirection.RTL;
/**
@@ -137,9 +137,7 @@
if (direction == null) direction = estimateDirection(text, isHtml);
var result = text;
if (contextDirection.isDirectionChange(direction)) {
- result = '''${direction == TextDirection.RTL ?
- BidiUtils.RLE :
- BidiUtils.LRE}$text${BidiUtils.PDF}''';
+ result = '''${direction == TextDirection.RTL ? RLE : LRE}$text$PDF''';
}
return result.concat(resetDir? _resetDir(text, direction, isHtml) : '');
}
@@ -151,7 +149,7 @@
* [isHtml] is true if [text] HTML or HTML-escaped.
*/
TextDirection estimateDirection(String text, [bool isHtml=false]) {
- return BidiUtils.estimateDirection(text, isHtml);
+ return estimateDirectionOfText(text, isHtml); //TODO~!!!
}
/**
@@ -166,14 +164,14 @@
// endsWithRtl and endsWithLtr are called only if needed (short-circuit).
if ((contextDirection == TextDirection.LTR &&
(direction == TextDirection.RTL ||
- BidiUtils.endsWithRtl(text, isHtml))) ||
+ endsWithRtl(text, isHtml))) ||
(contextDirection == TextDirection.RTL &&
(direction == TextDirection.LTR ||
- BidiUtils.endsWithLtr(text, isHtml)))) {
+ endsWithLtr(text, isHtml)))) {
if (contextDirection == TextDirection.LTR) {
- return BidiUtils.LRM;
+ return LRM;
} else {
- return BidiUtils.RLM;
+ return RLM;
}
} else {
return '';
« no previous file with comments | « no previous file | lib/i18n/bidi_utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698