Changeset 12288 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2017-06-01T01:20:37+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/upload/FixDataHook.java
r11913 r12288 186 186 @Override 187 187 public boolean checkUpload(APIDataSet apiDataSet) { 188 if (!Main.pref.getBoolean("fix.data.on.upload", true)) 189 return true; 190 191 List<OsmPrimitive> objectsToUpload = apiDataSet.getPrimitives(); 192 Collection<Command> cmds = new LinkedList<>(); 193 194 for (OsmPrimitive osm : objectsToUpload) { 195 Map<String, String> keys = new HashMap<>(osm.getKeys()); 196 if (!keys.isEmpty()) { 197 boolean modified = false; 198 for (FixData fix : deprecated) { 199 if (fix.fixKeys(keys, osm)) 200 modified = true; 188 if (Main.pref.getBoolean("fix.data.on.upload", true)) { 189 Collection<Command> cmds = new LinkedList<>(); 190 191 for (OsmPrimitive osm : apiDataSet.getPrimitives()) { 192 Map<String, String> keys = new HashMap<>(osm.getKeys()); 193 if (!keys.isEmpty()) { 194 boolean modified = false; 195 for (FixData fix : deprecated) { 196 if (fix.fixKeys(keys, osm)) 197 modified = true; 198 } 199 if (modified) { 200 cmds.add(new ChangePropertyCommand(Collections.singleton(osm), keys)); 201 } 201 202 } 202 if (modified) 203 cmds.add(new ChangePropertyCommand(Collections.singleton(osm), keys)); 204 } 205 } 206 207 if (!cmds.isEmpty()) 208 Main.main.undoRedo.add(new SequenceCommand(tr("Fix deprecated tags"), cmds)); 203 } 204 205 if (!cmds.isEmpty()) { 206 Main.main.undoRedo.add(new SequenceCommand(tr("Fix deprecated tags"), cmds)); 207 } 208 } 209 209 return true; 210 210 } -
trunk/src/org/openstreetmap/josm/command/ChangeRelationMemberRoleCommand.java
r10663 r12288 48 48 @Override 49 49 public boolean executeCommand() { 50 if (position < 0 || position >= relation.getMembersCount()) 51 return true; 52 53 oldRole = relation.getMember(position).getRole(); 54 if (newRole.equals(oldRole)) return true; 55 relation.setMember(position, new RelationMember(newRole, relation.getMember(position).getMember())); 56 57 oldModified = relation.isModified(); 58 relation.setModified(true); 50 if (position >= 0 && position < relation.getMembersCount()) { 51 oldRole = relation.getMember(position).getRole(); 52 if (!newRole.equals(oldRole)) { 53 relation.setMember(position, new RelationMember(newRole, relation.getMember(position).getMember())); 54 oldModified = relation.isModified(); 55 relation.setModified(true); 56 } 57 } 59 58 return true; 60 59 } -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/PresetLink.java
r11366 r12288 45 45 final String presetName = preset_name; 46 46 Optional<TaggingPreset> found = TaggingPresets.getTaggingPresets().stream().filter(preset -> presetName.equals(preset.name)).findFirst(); 47 if ( !found.isPresent())48 return false;49 TaggingPreset t = found.get();50 JLabel lbl = new TaggingPresetLabel(t);51 lbl.addMouseListener(new TaggingPresetMouseAdapter(t));52 p.add(lbl, GBC.eol().fill(GBC.HORIZONTAL));47 if (found.isPresent()) { 48 TaggingPreset t = found.get(); 49 JLabel lbl = new TaggingPresetLabel(t); 50 lbl.addMouseListener(new TaggingPresetMouseAdapter(t)); 51 p.add(lbl, GBC.eol().fill(GBC.HORIZONTAL)); 52 } 53 53 return false; 54 54 }
Note:
See TracChangeset
for help on using the changeset viewer.