Ticket #22808: 22808.patch
File 22808.patch, 1.3 KB (added by , 21 months ago) |
---|
-
src/org/openstreetmap/josm/command/AddPrimitivesCommand.java
5 5 6 6 import java.util.ArrayList; 7 7 import java.util.Collection; 8 import java.util.LinkedHashSet; 8 9 import java.util.List; 9 10 import java.util.Objects; 10 11 import java.util.Optional; 12 import java.util.Set; 11 13 import java.util.stream.Collectors; 12 14 13 15 import javax.swing.Icon; … … 126 128 } 127 129 createdPrimitives = PurgeCommand.topoSort(createdPrimitives); 128 130 } 131 // clear selection to improve performance, see #22808 132 Set<OsmPrimitive> clearedSelection = new LinkedHashSet<>(ds.getSelected()); 133 clearedSelection.removeAll(createdPrimitives); 134 ds.clearSelection(); 135 129 136 // reversed order, see #14620 130 137 for (int i = createdPrimitives.size() - 1; i >= 0; i--) { 131 138 OsmPrimitive osm = createdPrimitives.get(i); … … 137 144 ds.removePrimitive(osm); 138 145 } 139 146 } 147 // select still existing objects of old selection 148 ds.setSelected(clearedSelection); 140 149 } 141 150 142 151 @Override