Ignore:
Timestamp:
2017-09-07T21:01:54+02:00 (3 years ago)
Author:
Don-vip
Message:

fix #15262 - see #13036 - fix regression in ChangePropertyCommand + optimize commands creation when pasting tags

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/datatransfer/importers/PrimitiveTagTransferPaster.java

    r12720 r12769  
    2727
    2828/**
    29  * This class helps pasting tags form other primitives. It handles resolving conflicts.
     29 * This class helps pasting tags from other primitives. It handles resolving conflicts.
    3030 * @author Michael Zangl
    3131 * @since 10737
     
    5050        List<Command> commands = new ArrayList<>();
    5151        for (Tag tag : tagPaster.execute()) {
    52             commands.add(new ChangePropertyCommand(selection, tag.getKey(), "".equals(tag.getValue()) ? null : tag.getValue()));
     52            ChangePropertyCommand cmd = new ChangePropertyCommand(selection, tag.getKey(), "".equals(tag.getValue()) ? null : tag.getValue());
     53            if (cmd.getObjectsNumber() > 0) {
     54                commands.add(cmd);
     55            }
    5356        }
    5457        commitCommands(selection, commands);
Note: See TracChangeset for help on using the changeset viewer.