Replace BidiFormatter's temporary implementation of htmlEscape with a call to SafeHtml's escaper.


git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@9029 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/i18n/shared/BidiFormatter.java b/user/src/com/google/gwt/i18n/shared/BidiFormatter.java
index 09170ee..12060e4 100644
--- a/user/src/com/google/gwt/i18n/shared/BidiFormatter.java
+++ b/user/src/com/google/gwt/i18n/shared/BidiFormatter.java
@@ -18,6 +18,7 @@
 
 import com.google.gwt.i18n.client.HasDirection.Direction;
 import com.google.gwt.i18n.client.LocaleInfo;
+import com.google.gwt.safehtml.shared.SafeHtmlUtils;
 
 /**
  * Utility class for formatting text for display in a potentially
@@ -466,7 +467,7 @@
     boolean dirCondition = dir != Direction.DEFAULT && dir != contextDir;
     String origStr = str;
     if (!isHtml) {
-      str = htmlEscape(str);
+      str = SafeHtmlUtils.htmlEscape(str);
     }
 
     StringBuilder result = new StringBuilder();
@@ -641,9 +642,4 @@
       return "";
     }
   }
-
-  private String htmlEscape(String str) {
-    // TODO(tomerigo): use a proper escaper class once such exists.
-    return str.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;").replace("\n", "<br>");
-  }
 }