- Timestamp:
- 2015-10-19T23:49:11+02:00 (9 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/command/conflict/ConflictAddCommand.java
r8910 r8914 61 61 @Override 62 62 public void undoCommand() { 63 if (Main. map != null&& !Main.map.mapView.hasLayer(getLayer())) {63 if (Main.isDisplayingMapView() && !Main.map.mapView.hasLayer(getLayer())) { 64 64 Main.warn(tr("Layer ''{0}'' does not exist any more. Cannot remove conflict for object ''{1}''.", 65 65 getLayer().getName(), -
trunk/src/org/openstreetmap/josm/command/conflict/ConflictResolveCommand.java
r8910 r8914 68 68 super.undoCommand(); 69 69 70 if (!Main.map.mapView.hasLayer(getLayer())) { 71 Main.warn(tr("Cannot undo command ''{0}'' because layer ''{1}'' is not present any more", 72 this.toString(), 73 getLayer().toString() 74 )); 75 return; 70 if (Main.isDisplayingMapView()) { 71 if (!Main.map.mapView.hasLayer(getLayer())) { 72 Main.warn(tr("Cannot undo command ''{0}'' because layer ''{1}'' is not present any more", 73 this.toString(), 74 getLayer().toString() 75 )); 76 return; 77 } 78 79 Main.map.mapView.setActiveLayer(getLayer()); 76 80 } 77 78 Main.map.mapView.setActiveLayer(getLayer());79 81 reconstituteConflicts(); 80 82 } -
trunk/test/unit/org/openstreetmap/josm/command/conflict/ConflictAddCommandTest.java
r8910 r8914 3 3 4 4 import static org.junit.Assert.assertFalse; 5 import static org.junit.Assert.assertNotNull; 5 6 import static org.junit.Assert.assertTrue; 6 7 8 import org.junit.BeforeClass; 7 9 import org.junit.Test; 10 import org.openstreetmap.josm.JOSMFixture; 8 11 import org.openstreetmap.josm.data.conflict.Conflict; 9 12 import org.openstreetmap.josm.data.osm.DataSet; 13 import org.openstreetmap.josm.data.osm.Node; 10 14 import org.openstreetmap.josm.data.osm.OsmPrimitive; 11 15 import org.openstreetmap.josm.gui.layer.OsmDataLayer; … … 15 19 */ 16 20 public class ConflictAddCommandTest { 21 22 /** 23 * Setup test. 24 */ 25 @BeforeClass 26 public static void setUpBeforeClass() { 27 JOSMFixture.createUnitTestFixture().init(); 28 } 17 29 18 30 /** … … 31 43 assertTrue(layer.getConflicts().isEmpty()); 32 44 } 45 46 /** 47 * Unit test of {@code ConflictAddCommand#getDescriptionIcon} method. 48 */ 49 @Test 50 public void testGetDescriptionIcon() { 51 OsmDataLayer layer = new OsmDataLayer(new DataSet(), null, null); 52 Conflict<Node> conflict = new Conflict<>(new Node(), new Node()); 53 assertNotNull(new ConflictAddCommand(layer, conflict).getDescriptionIcon()); 54 } 33 55 }
Note:
See TracChangeset
for help on using the changeset viewer.