Changeset 33374 in osm
- Timestamp:
- 2017-06-06T00:23:42+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/undelete/src/org/openstreetmap/josm/plugins/undelete/UndeleteAction.java
r33263 r33374 71 71 72 72 HistoryOsmPrimitive hPrimitive1 = h.getLatest(); 73 HistoryOsmPrimitive hPrimitive2 ;73 HistoryOsmPrimitive hPrimitive2 = null; 74 74 75 75 boolean visible = hPrimitive1.isVisible(); … … 82 82 primitive = layer.data.getPrimitiveById(id, type); 83 83 } else { 84 // We search n-1 version with redaction robustness 85 int idx = 1; 86 int n = h.getNumVersions(); 87 while (hPrimitive2 == null && idx < n) { 88 hPrimitive2 = h.getByVersion(n - idx++); 89 } 84 90 if (type.equals(OsmPrimitiveType.NODE)) { 85 91 // We get version and user from the latest version, 86 92 // coordinates and tags from n-1 version 87 hPrimitive2 = h.getByVersion(h.getNumVersions() - 1);88 89 93 Node node = new Node(id, (int) hPrimitive1.getVersion()); 90 94 … … 99 103 // nodes and tags from n-1 version 100 104 hPrimitive1 = h.getLatest(); 101 hPrimitive2 = h.getByVersion(h.getNumVersions() - 1);102 105 103 106 Way way = new Way(id, (int) hPrimitive1.getVersion()); … … 119 122 primitive = new Relation(); 120 123 hPrimitive1 = h.getLatest(); 121 hPrimitive2 = h.getByVersion(h.getNumVersions() - 1);122 124 123 125 Relation rel = new Relation(id, (int) hPrimitive1.getVersion());
Note:
See TracChangeset
for help on using the changeset viewer.