Changeset 10467 in josm for trunk/src/org/openstreetmap/josm/data/UndoRedoHandler.java
- Timestamp:
- 2016-06-24T00:30:42+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/UndoRedoHandler.java
r10452 r10467 74 74 */ 75 75 public synchronized void add(final Command c) { 76 DataSet ds = Main.getLayerManager().getEditDataSet(); 77 Collection<? extends OsmPrimitive> oldSelection = ds.getSelected(); 76 DataSet ds = c.getAffectedDataSet(); 77 if (ds == null) { 78 // old, legacy behaviour 79 ds = Main.getLayerManager().getEditDataSet(); 80 } 81 Collection<? extends OsmPrimitive> oldSelection = null; 82 if (ds != null) { 83 oldSelection = ds.getSelected(); 84 } 78 85 addNoRedraw(c); 79 86 afterAdd(); 80 87 81 88 // the command may have changed the selection so tell the listeners about the current situation 82 fireIfSelectionChanged(ds, oldSelection); 89 if (ds != null) { 90 fireIfSelectionChanged(ds, oldSelection); 91 } 83 92 } 84 93
Note:
See TracChangeset
for help on using the changeset viewer.