Changeset 9439 in josm for trunk/src/org
- Timestamp:
- 2016-01-14T12:52:35+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java
r9371 r9439 124 124 TagCollection wayTags = TagCollection.unionOfAllPrimitives(ways); 125 125 126 final List<Command> reverseWayTagCommands = new LinkedList<>(); 126 127 List<Way> reversedWays = new LinkedList<>(); 127 128 List<Way> unreversedWays = new LinkedList<>(); … … 158 159 ReverseWayTagCorrector reverseWayTagCorrector = new ReverseWayTagCorrector(); 159 160 List<Way> reversedTagWays = new ArrayList<>(reversedWays.size()); 160 Collection<Command> changePropertyCommands = null;161 161 for (Way w : reversedWays) { 162 162 Way wnew = new Way(w); 163 163 reversedTagWays.add(wnew); 164 changePropertyCommands = reverseWayTagCorrector.execute(w, wnew); 165 } 166 if ((changePropertyCommands != null) && !changePropertyCommands.isEmpty()) { 167 for (Command c : changePropertyCommands) { 168 c.executeCommand(); 169 } 164 reverseWayTagCommands.addAll(reverseWayTagCorrector.execute(w, wnew)); 165 } 166 if (!reverseWayTagCommands.isEmpty()) { 167 // commands need to be executed for CombinePrimitiveResolverDialog 168 Main.main.undoRedo.add(new SequenceCommand(tr("Reverse Ways"), reverseWayTagCommands)); 170 169 } 171 170 wayTags = TagCollection.unionOfAllPrimitives(reversedTagWays); … … 180 179 modifiedTargetWay.setNodes(path); 181 180 182 List<Command> resolution = CombinePrimitiveResolverDialog.launchIfNecessary(wayTags, ways, Collections.singleton(targetWay)); 181 final List<Command> resolution; 182 try { 183 resolution = CombinePrimitiveResolverDialog.launchIfNecessary(wayTags, ways, Collections.singleton(targetWay)); 184 } finally { 185 if (!reverseWayTagCommands.isEmpty()) { 186 // undo reverseWayTagCorrector and merge into SequenceCommand below 187 Main.main.undoRedo.undo(); 188 } 189 } 183 190 184 191 List<Command> cmds = new LinkedList<>(); … … 187 194 188 195 cmds.add(new ChangeCommand(targetWay, modifiedTargetWay)); 196 cmds.addAll(reverseWayTagCommands); 189 197 cmds.addAll(resolution); 190 198 cmds.add(new DeleteCommand(deletedWays));
Note:
See TracChangeset
for help on using the changeset viewer.