Changeset 2790 in josm for trunk/src/org
- Timestamp:
- 2010-01-09T16:37:29+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
r2777 r2790 12 12 import java.util.Collection; 13 13 import java.util.Collections; 14 import java.util.HashSet; 14 15 import java.util.LinkedList; 15 16 import java.util.List; … … 201 202 } 202 203 203 public static IntegergetSelection(SearchSetting s, Collection<OsmPrimitive> sel, Function f) {204 IntegerfoundMatches = 0;204 public static int getSelection(SearchSetting s, Collection<OsmPrimitive> sel, Function f) { 205 int foundMatches = 0; 205 206 try { 206 207 String searchText = s.text; … … 211 212 /*System.out.println(searchText);*/ 212 213 SearchCompiler.Match matcher = SearchCompiler.compile(searchText, s.caseSensitive, s.regexSearch); 213 foundMatches = 0; 214 215 if (s.mode == SearchMode.replace) { 216 sel.clear(); 217 } 218 214 219 for (OsmPrimitive osm : Main.main.getCurrentDataSet().allNonDeletedCompletePrimitives()) { 215 220 if (s.mode == SearchMode.replace) { … … 217 222 sel.add(osm); 218 223 ++foundMatches; 219 } else {220 sel.remove(osm);221 224 } 222 225 } else if (s.mode == SearchMode.add && !f.isSomething(osm) && matcher.match(osm)) { … … 262 265 263 266 final DataSet ds = Main.main.getCurrentDataSet(); 264 Collection<OsmPrimitive> sel = ds.getSelected();267 Collection<OsmPrimitive> sel = new HashSet<OsmPrimitive>(ds.getSelected()); 265 268 int foundMatches = getSelection(s, sel, new Function(){ 266 269 public Boolean isSomething(OsmPrimitive o){
Note:
See TracChangeset
for help on using the changeset viewer.