Ignore:
Timestamp:
2021-03-28T20:43:23+02:00 (4 years ago)
Author:
simon04
Message:

fix #20678 - History Browser: reset coordinates of a node to previous versions (via popup menu)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserPanel.java

    r14463 r17684  
    1010
    1111import org.openstreetmap.josm.actions.JosmAction;
     12import org.openstreetmap.josm.data.osm.DataSet;
     13import org.openstreetmap.josm.data.osm.OsmPrimitive;
     14import org.openstreetmap.josm.data.osm.PrimitiveId;
     15import org.openstreetmap.josm.gui.MainApplication;
    1216import org.openstreetmap.josm.tools.Destroyable;
    1317
     
    6468    }
    6569
     70    protected OsmPrimitive getPrimitiveFromDataSet(PointInTimeType pointInTime) {
     71        DataSet dataSet = MainApplication.getLayerManager().getEditDataSet();
     72        PrimitiveId primitiveId = model.getPointInTime(pointInTime);
     73        if (dataSet == null || primitiveId == null) {
     74            return null;
     75        }
     76        return dataSet.getPrimitiveById(primitiveId.getUniqueId(), primitiveId.getType());
     77    }
     78
    6679    protected final <T extends AbstractAction> T trackJosmAction(T action) {
    6780        if (action instanceof JosmAction) {
Note: See TracChangeset for help on using the changeset viewer.