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

Side by Side Diff: pkg/intl/lib/bidi_formatter.dart

Issue 140843002: [Intl] Cleanup some code (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: integrate feedback Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/intl/lib/bidi_utils.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of intl; 5 part of intl;
6 6
7 /** 7 /**
8 * Bidi stands for Bi-directional text. 8 * Bidi stands for Bi-directional text.
9 * According to [Wikipedia](http://en.wikipedia.org/wiki/Bi-directional_text): 9 * According to [Wikipedia](http://en.wikipedia.org/wiki/Bi-directional_text):
10 * Bi-directional text is text containing text in both text directionalities, 10 * Bi-directional text is text containing text in both text directionalities,
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 * HTML-escaped. 165 * HTML-escaped.
166 */ 166 */
167 String _resetDir(String text, TextDirection direction, bool isHtml) { 167 String _resetDir(String text, TextDirection direction, bool isHtml) {
168 // endsWithRtl and endsWithLtr are called only if needed (short-circuit). 168 // endsWithRtl and endsWithLtr are called only if needed (short-circuit).
169 if ((contextDirection == TextDirection.LTR && 169 if ((contextDirection == TextDirection.LTR &&
170 (direction == TextDirection.RTL || 170 (direction == TextDirection.RTL ||
171 Bidi.endsWithRtl(text, isHtml))) || 171 Bidi.endsWithRtl(text, isHtml))) ||
172 (contextDirection == TextDirection.RTL && 172 (contextDirection == TextDirection.RTL &&
173 (direction == TextDirection.LTR || 173 (direction == TextDirection.LTR ||
174 Bidi.endsWithLtr(text, isHtml)))) { 174 Bidi.endsWithLtr(text, isHtml)))) {
175 if (contextDirection == TextDirection.LTR) { 175 return contextDirection == TextDirection.LTR ? Bidi.LRM : Bidi.RLM;
176 return Bidi.LRM;
177 } else {
178 return Bidi.RLM;
179 }
180 } else { 176 } else {
181 return ''; 177 return '';
182 } 178 }
183 } 179 }
184 } 180 }
OLDNEW
« no previous file with comments | « no previous file | pkg/intl/lib/bidi_utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698