Changeset 12769 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2017-09-07T21:01:54+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/command/ChangePropertyCommand.java
r12726 r12769 140 140 141 141 if (newVal == null || newVal.isEmpty()) { 142 if (oldVal != null) 142 if (oldVal != null) { 143 143 // new value is null and tag exists (will delete tag) 144 144 modified = true; 145 } else if (oldVal == null || !newVal.equals(oldVal)) 145 break; 146 } 147 } else if (oldVal == null || !newVal.equals(oldVal)) { 146 148 // new value is not null and is different from current value 147 149 modified = true; 150 break; 151 } 148 152 } 149 153 if (modified) … … 154 158 @Override 155 159 public boolean executeCommand() { 160 if (objects.isEmpty()) 161 return true; 156 162 final DataSet dataSet = objects.get(0).getDataSet(); 157 163 if (dataSet != null) { -
trunk/src/org/openstreetmap/josm/gui/datatransfer/importers/PrimitiveTagTransferPaster.java
r12720 r12769 27 27 28 28 /** 29 * This class helps pasting tags f orm other primitives. It handles resolving conflicts.29 * This class helps pasting tags from other primitives. It handles resolving conflicts. 30 30 * @author Michael Zangl 31 31 * @since 10737 … … 50 50 List<Command> commands = new ArrayList<>(); 51 51 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 } 53 56 } 54 57 commitCommands(selection, commands);
Note:
See TracChangeset
for help on using the changeset viewer.