Ignore:
Timestamp:
2020-10-29T00:14:23+01:00 (4 years ago)
Author:
simon04
Message:

EditLevel0LAction: support deleting tags

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/comfort0/src/net/simon04/comfort0/EditLevel0LAction.java

    r35628 r35629  
    3030import org.openstreetmap.josm.data.osm.PrimitiveData;
    3131import org.openstreetmap.josm.data.osm.RelationData;
     32import org.openstreetmap.josm.data.osm.TagMap;
    3233import org.openstreetmap.josm.data.osm.WayData;
    3334import org.openstreetmap.josm.gui.MainApplication;
     
    137138            newInstance.load(fromLevel0L);
    138139
    139             final boolean equalKeys = Objects.equals(newInstance.getKeys(), fromDataSet.getKeys());
    140             if (!equalKeys) {
    141                 final ChangePropertyCommand command = new ChangePropertyCommand(Collections.singleton(fromDataSet), newInstance.getKeys());
     140            final TagMap newKeys = newInstance.getKeys();
     141            if (!Objects.equals(newKeys, fromDataSet.getKeys())) {
     142                fromDataSet.getKeys().keySet().forEach(key ->
     143                                newKeys.computeIfAbsent(key, k -> ""));
     144                final ChangePropertyCommand command = new ChangePropertyCommand(Collections.singleton(fromDataSet), newKeys);
    142145                commands.add(command);
    143146            }
Note: See TracChangeset for help on using the changeset viewer.