Changeset 5146 in josm for trunk/src/org
- Timestamp:
- 2012-03-31T20:44:13+02:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java
r4734 r5146 441 441 User user = p.getUser(); 442 442 if (user != null) 443 return "<html>" + XmlWriter.encode(user.getName()) + " <font color=gray>(" + user.getId() + ")</font></html>"; 443 return "<html>" + XmlWriter.encode(user.getName(), true) + " <font color=gray>(" + user.getId() + ")</font></html>"; 444 444 } 445 445 return null; -
trunk/src/org/openstreetmap/josm/io/XmlWriter.java
r4645 r5146 22 22 } 23 23 24 public static String encode(String unencoded) { 25 return encode(unencoded, false); 26 } 27 24 28 /** 25 29 * Encode the given string in XML1.0 format. 26 30 * Optimized to fast pass strings that don't need encoding (normal case). 31 * 32 * @param unencoded the unencoded input string 33 * @param keepApos true if apostrophe sign should stay as it is (in order to work around 34 * a Java bug that renders 35 * new JLabel("<html>'</html>") 36 * literally as 6 character string, see #7558) 27 37 */ 28 public static String encode(String unencoded) { 38 public static String encode(String unencoded, boolean keepApos) { 29 39 StringBuilder buffer = null; 30 40 for (int i = 0; i < unencoded.length(); ++i) { 31 String encS = XmlWriter.encoding.get(unencoded.charAt(i)); 41 String encS = null; 42 if (!keepApos || unencoded.charAt(i) != '\'') { 43 encS = XmlWriter.encoding.get(unencoded.charAt(i)); 44 } 32 45 if (encS != null) { 33 46 if (buffer == null) {
Note:
See TracChangeset
for help on using the changeset viewer.