Ticket #5303: 0002-Only-cleanup-uploaded-deleted-nodes.patch

File 0002-Only-cleanup-uploaded-deleted-nodes.patch, 2.3 KB (added by Matthew Bell, 11 years ago)
  • src/org/openstreetmap/josm/data/osm/DataSet.java

    From b417ac598f98293caf8869fe0b0ef58a16c5cd8c Mon Sep 17 00:00:00 2001
    From: Matthew W. S. Bell <matthew@bells23.org.uk>
    Date: Fri, 6 Aug 2010 16:34:08 +0100
    Subject: [PATCH 2/4] Only cleanup uploaded deleted nodes.
    
    ---
     src/org/openstreetmap/josm/data/osm/DataSet.java   |   12 +-----------
     .../openstreetmap/josm/gui/layer/OsmDataLayer.java |    2 +-
     2 files changed, 2 insertions(+), 12 deletions(-)
    
    diff --git a/src/org/openstreetmap/josm/data/osm/DataSet.java b/src/org/openstreetmap/josm/data/osm/DataSet.java
    index 6b37453..7c21a59 100644
    a b public class DataSet implements Cloneable { 
    917917        synchronized (selectionLock) {
    918918            while (it.hasNext()) {
    919919                OsmPrimitive primitive = it.next();
    920                 if (primitive.isDeleted()) {
     920                if (primitive.isDeleted() && !primitive.isModified()) {
    921921                    selectedPrimitives.remove(primitive);
    922922                    selectionSnapshot = null;
    923923                    allPrimitives.remove(primitive);
    public class DataSet implements Cloneable { 
    928928            }
    929929            if (changed) {
    930930                selectionSnapshot = null;
    931             }
    932         }
    933         return changed;
    934     }
    935 
    936     /**
    937      * Removes all primitives from the dataset and resets the currently selected primitives
    938      * to the empty collection. Also notifies selection change listeners if necessary.
    939      *
    940      */
    941931    public void clear() {
    942932        beginUpdate();
    943933        try {
  • src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java

    diff --git a/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java b/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
    index 7078082..0eef27b 100644
    a b public class OsmDataLayer extends Layer implements Listener, SelectionChangedLis 
    397397        Main.main.undoRedo.clean(this);
    398398
    399399        // if uploaded, clean the modified flags as well
    400         data.cleanupDeletedPrimitives();
    401400        for (OsmPrimitive p: data.allPrimitives()) {
    402401            if (processed.contains(p)) {
    403402                p.setModified(false);
    404403            }
    405404        }
     405        data.cleanupDeletedPrimitives();
    406406    }
    407407
    408408