Changeset 12401 in josm for trunk/src/org
- Timestamp:
- 2017-06-12T00:11:39+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/autofilter/AutoFilterManager.java
r12400 r12401 171 171 172 172 private static Set<String> getTagValues(String key) { 173 BBox bbox = Main.map.mapView.getState().getViewArea().getLatLonBoundsBox().toBBox();174 173 DataSet ds = Main.getLayerManager().getEditDataSet(); 175 174 Set<String> values = new TreeSet<>(); 176 Consumer<OsmPrimitive> consumer = o -> { 177 String value = o.get(key); 178 if (value != null) { 179 for (String v : value.split(";")) { 180 values.add(v); 175 if (ds != null) { 176 BBox bbox = Main.map.mapView.getState().getViewArea().getLatLonBoundsBox().toBBox(); 177 Consumer<OsmPrimitive> consumer = o -> { 178 String value = o.get(key); 179 if (value != null) { 180 for (String v : value.split(";")) { 181 values.add(v); 182 } 181 183 } 182 } 183 };184 ds.searchNodes(bbox).forEach(consumer);185 ds.searchWays(bbox).forEach(consumer);186 ds.searchRelations(bbox).forEach(consumer);184 }; 185 ds.searchNodes(bbox).forEach(consumer); 186 ds.searchWays(bbox).forEach(consumer); 187 ds.searchRelations(bbox).forEach(consumer); 188 } 187 189 return values; 188 190 }
Note:
See TracChangeset
for help on using the changeset viewer.