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

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

Issue 11032035: Move Bidi functions into methods to make the docs look better (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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/bidi_utils.dart » ('j') | pkg/intl/lib/bidi_utils.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/intl/lib/bidi_formatter.dart
===================================================================
--- pkg/intl/lib/bidi_formatter.dart (revision 13189)
+++ pkg/intl/lib/bidi_formatter.dart (working copy)
@@ -155,7 +155,9 @@
if (direction == null) direction = estimateDirection(text, isHtml);
var result = text;
if (contextDirection.isDirectionChange(direction)) {
- result = '''${direction == TextDirection.RTL ? RLE : LRE}$text$PDF''';
+ var marker = direction == TextDirection.RTL ? Bidi.RLE : Bidi.LRE;
+ result = "${marker}$text${Bidi.PDF}";
+
}
return result.concat(resetDir? _resetDir(text, direction, isHtml) : '');
}
@@ -167,7 +169,7 @@
* [isHtml] is true if [text] HTML or HTML-escaped.
*/
TextDirection estimateDirection(String text, [bool isHtml=false]) {
- return estimateDirectionOfText(text, isHtml); //TODO~!!!
+ return Bidi.estimateDirectionOfText(text, isHtml); //TODO~!!!
}
/**
@@ -182,14 +184,14 @@
// endsWithRtl and endsWithLtr are called only if needed (short-circuit).
if ((contextDirection == TextDirection.LTR &&
(direction == TextDirection.RTL ||
- endsWithRtl(text, isHtml))) ||
+ Bidi.endsWithRtl(text, isHtml))) ||
(contextDirection == TextDirection.RTL &&
(direction == TextDirection.LTR ||
- endsWithLtr(text, isHtml)))) {
+ Bidi.endsWithLtr(text, isHtml)))) {
if (contextDirection == TextDirection.LTR) {
- return LRM;
+ return Bidi.LRM;
} else {
- return RLM;
+ return Bidi.RLM;
}
} else {
return '';
« no previous file with comments | « no previous file | pkg/intl/lib/bidi_utils.dart » ('j') | pkg/intl/lib/bidi_utils.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698