X-Git-Url: https://gitweb.fperrin.net/?a=blobdiff_plain;f=tim%2Fprune%2Fundo%2FUndoEditPoint.java;h=be41ea0d88f92c7ce15ef966a253a607b2fe853f;hb=4d5796d02a15808311c09448d79e6e7d1de9d636;hp=1ee16dc72ea1ae6baa0732838ee80af2b3ed494a;hpb=54b9d8bc8f0025ccf97a67d9dd217ef1f9cf082f;p=GpsPrune.git diff --git a/tim/prune/undo/UndoEditPoint.java b/tim/prune/undo/UndoEditPoint.java index 1ee16dc..be41ea0 100644 --- a/tim/prune/undo/UndoEditPoint.java +++ b/tim/prune/undo/UndoEditPoint.java @@ -2,6 +2,7 @@ package tim.prune.undo; import tim.prune.I18nManager; import tim.prune.data.DataPoint; +import tim.prune.data.Field; import tim.prune.data.TrackInfo; import tim.prune.function.edit.FieldEditList; @@ -32,7 +33,9 @@ public class UndoEditPoint implements UndoOperation public String getDescription() { String desc = I18nManager.getText("undo.editpoint"); - String newName = _undoFieldList.getEdit(0).getValue(); + String newName = null; + if (_undoFieldList.getEdit(0).getField() == Field.WAYPT_NAME) + newName = _undoFieldList.getEdit(0).getValue(); String pointName = _originalPoint.getWaypointName(); if (newName != null && !newName.equals("")) desc = desc + " " + newName; @@ -49,7 +52,7 @@ public class UndoEditPoint implements UndoOperation public void performUndo(TrackInfo inTrackInfo) throws UndoException { // Restore contents of point into track - if (!inTrackInfo.getTrack().editPoint(_originalPoint, _undoFieldList)) + if (!inTrackInfo.getTrack().editPoint(_originalPoint, _undoFieldList, true)) { // throw exception if failed throw new UndoException(getDescription());