]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - tim/prune/data/DataPoint.java
Version 11, August 2010
[GpsPrune.git] / tim / prune / data / DataPoint.java
index 7acd4f9e364314985d0ea2abb85996901352037b..bba7adc670f90078a8deb0a3280b6fa109ef8a39 100644 (file)
@@ -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
         */