Changeset 2517 in josm


Ignore:
Timestamp:
2009-11-26T20:43:56+01:00 (15 years ago)
Author:
jttt
Message:

Fixed #3920 Selection history is broken

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/DataSet.java

    r2515 r2517  
    248248     * dataset. (However, the selection does only change in the active layer)
    249249     */
    250     public static Collection<SelectionChangedListener> selListeners = 
     250    public static Collection<SelectionChangedListener> selListeners =
    251251        Collections.synchronizedList(new LinkedList<SelectionChangedListener>());
    252 
    253     /**
    254      * notifies all registered selection change listeners about the current selection of
    255      * primitives
    256      *
    257      * @param sel the current selection
    258      */
    259     private static void notifySelectionChangeListeners(Collection<? extends OsmPrimitive> sel) {
    260         synchronized (selListeners) {
    261             for (SelectionChangedListener l : selListeners) {
    262                 l.selectionChanged(sel);
    263             }
    264         }
    265     }
    266252
    267253    /**
     
    271257     */
    272258    public void fireSelectionChanged(){
    273         notifySelectionChangeListeners(selectedPrimitives);
     259        synchronized (selListeners) {
     260            List<? extends OsmPrimitive> currentSelection = Collections.unmodifiableList(new ArrayList<OsmPrimitive>(selectedPrimitives));
     261            for (SelectionChangedListener l : selListeners) {
     262                l.selectionChanged(currentSelection);
     263            }
     264        }
    274265    }
    275266
Note: See TracChangeset for help on using the changeset viewer.