Changeset 5798 in josm


Ignore:
Timestamp:
2013-03-23T00:51:05+01:00 (12 years ago)
Author:
Don-vip
Message:

Do not trigger selectionChanged events when selecting the same primitives several times

File:
1 edited

Legend:

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

    r5674 r5798  
    590590        boolean changed;
    591591        synchronized (selectionLock) {
    592             boolean wasEmpty = selectedPrimitives.isEmpty();
     592            LinkedHashSet<OsmPrimitive> oldSelection = new LinkedHashSet<OsmPrimitive>(selectedPrimitives);
    593593            selectedPrimitives = new LinkedHashSet<OsmPrimitive>();
    594             changed = addSelected(selection, false)
    595                     || (!wasEmpty && selectedPrimitives.isEmpty());
     594            addSelected(selection, false);
     595            changed = !oldSelection.equals(selectedPrimitives);
    596596            if (changed) {
    597597                selectionSnapshot = null;
Note: See TracChangeset for help on using the changeset viewer.