Changeset 9940 in josm for trunk/src/org/openstreetmap/josm/actions
- Timestamp:
- 2016-03-06T17:12:42+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions/search
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
r9696 r9940 773 773 return Collections.<ActionParameter<?>>singletonList(new SearchSettingsActionParameter(SEARCH_EXPRESSION)); 774 774 } 775 776 public static String escapeStringForSearch(String s) {777 return s.replace("\\", "\\\\").replace("\"", "\\\"");778 }779 775 } -
trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
r9930 r9940 1745 1745 return searchFlags; 1746 1746 } 1747 1748 static String escapeStringForSearch(String s) { 1749 return s.replace("\\", "\\\\").replace("\"", "\\\""); 1750 } 1751 1752 /** 1753 * Builds a search string for the given tag. If value is empty, the existence of the key is checked. 1754 * 1755 * @param key the tag key 1756 * @param value the tag value 1757 * @return a search string for the given tag 1758 */ 1759 public static String buildSearchStringForTag(String key, String value) { 1760 final String forKey = '"' + escapeStringForSearch(key) + '"' + '='; 1761 if (value == null || value.isEmpty()) { 1762 return forKey + "*"; 1763 } else { 1764 return forKey + '"' + escapeStringForSearch(value) + '"'; 1765 } 1766 } 1747 1767 }
Note:
See TracChangeset
for help on using the changeset viewer.