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

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

Issue 11194025: Second round of cleanups for new optional parameter semantics. (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
Index: pkg/intl/lib/bidi_utils.dart
===================================================================
--- pkg/intl/lib/bidi_utils.dart (revision 13712)
+++ pkg/intl/lib/bidi_utils.dart (working copy)
@@ -315,7 +315,8 @@
* Otherwise, returns UNKNOWN, which is used to mean `neutral`.
* Numbers and URLs are counted as weakly LTR.
*/
- static TextDirection estimateDirectionOfText(String text, [bool isHtml=false]) {
+ static TextDirection estimateDirectionOfText(String text,
+ {bool isHtml: false}) {
text = isHtml? stripHtmlIfNeeded(text) : text;
var rtlCount = 0;
var total = 0;
@@ -393,7 +394,7 @@
* text should be laid out in RTL direction. If [isHtml] is true, the string
* is HTML or HTML-escaped.
*/
- static bool detectRtlDirectionality(String str, [bool isHtml]) {
- return estimateDirectionOfText(str, isHtml) == TextDirection.RTL;
+ static bool detectRtlDirectionality(String str, {bool isHtml}) {
Lasse Reichstein Nielsen 2012/10/17 14:56:10 Give it a default value of false, instead of relyi
regis 2012/10/17 19:58:16 Done. But I need to postpone these changes in bidi
+ return estimateDirectionOfText(str, isHtml: isHtml) == TextDirection.RTL;
}
}

Powered by Google App Engine
This is Rietveld 408576698