Changeset 35396 in osm for applications/editors/josm
- Timestamp:
- 2020-03-26T08:24:51+01:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/undelete/src/org/openstreetmap/josm/plugins/undelete/UndeleteAction.java
r34957 r35396 83 83 84 84 HistoryOsmPrimitive hPrimitive1 = h.getLatest(); 85 HistoryOsmPrimitive hPrimitive2 = null;86 85 87 86 boolean visible = hPrimitive1.isVisible(); … … 103 102 restored.add(primitive); 104 103 } else { 105 // We search n-1 version with redaction robustness104 // We search latest visible version < n with redaction robustness 106 105 long idx = 1; 107 106 long n = hPrimitive1.getVersion(); 108 while (hPrimitive2 == null && idx < n) { 107 HistoryOsmPrimitive hPrimitive2 = null; 108 while (idx < n) { 109 109 hPrimitive2 = h.getByVersion(n - idx++); 110 if (hPrimitive2 != null && hPrimitive2.isVisible()) { 111 // don't restore an invisible object 112 break; 113 } 110 114 } 111 115 if (type == OsmPrimitiveType.NODE) { 112 116 // We get version and user from the latest version, 113 // coordinates and tags from n-1 version117 // coordinates and tags from latest visible version < n 114 118 Node node = new Node(id, (int) hPrimitive1.getVersion()); 115 119 … … 122 126 } else if (type == OsmPrimitiveType.WAY) { 123 127 // We get version and user from the latest version, 124 // nodes and tags from n-1 version128 // nodes and tags from latest visible version < n 125 129 hPrimitive1 = h.getLatest(); 126 130
Note:
See TracChangeset
for help on using the changeset viewer.