X-Git-Url: https://gitweb.fperrin.net/?p=GpsPrune.git;a=blobdiff_plain;f=tim%2Fprune%2Fdata%2FDataPoint.java;h=bba7adc670f90078a8deb0a3280b6fa109ef8a39;hp=7acd4f9e364314985d0ea2abb85996901352037b;hb=140e9d165f85c3d4f0435a311e091209313faa2a;hpb=c0387c124840c9407e040600fda88f3c3e8f6aa6 diff --git a/tim/prune/data/DataPoint.java b/tim/prune/data/DataPoint.java index 7acd4f9..bba7adc 100644 --- a/tim/prune/data/DataPoint.java +++ b/tim/prune/data/DataPoint.java @@ -152,12 +152,7 @@ public class DataPoint _fieldValues[fieldIndex] = inValue; // Increment edit count on all field edits except segment if (inField != Field.NEW_SEGMENT) { - if (!inUndo) { - _modifyCount++; - } - else { - _modifyCount--; - } + setModified(inUndo); } // Change Coordinate, Altitude, Name or Timestamp fields after edit if (_altitude != null && _altitude.getFormat() != Altitude.Format.NO_FORMAT) { @@ -170,6 +165,20 @@ public class DataPoint } } + /** + * Either increment or decrement the modify count, depending on whether it's an undo or not + * @param inUndo true for undo, false otherwise + */ + public void setModified(boolean inUndo) + { + if (!inUndo) { + _modifyCount++; + } + else { + _modifyCount--; + } + } + /** * @return field list for this point */