* @param inStart start of range
* @param inEnd end of range
* @param inOffset offset to add (-ve to subtract)
+ * @param inUndo true for undo operation
* @return true on success
*/
- public boolean addTimeOffset(int inStart, int inEnd, long inOffset)
+ public boolean addTimeOffset(int inStart, int inEnd, long inOffset, boolean inUndo)
{
// sanity check
if (inStart < 0 || inEnd < 0 || inStart >= inEnd || inEnd >= _numPoints) {
// This point has a timestamp so add the offset to it
foundTimestamp = true;
timestamp.addOffset(inOffset);
+ _dataPoints[i].setModified(inUndo);
}
}
return foundTimestamp;
// This point has an altitude so add the offset to it
foundAlt = true;
alt.addOffset(inOffset, inFormat, inDecimals);
+ _dataPoints[i].setModified(false);
}
}
// needs to be scaled again
}
/**
- * @return true if track has altitude data (which are not all zero)
+ * @return true if track has altitude data
*/
public boolean hasAltitudeData()
{
- return getAltitudeRange().getMaximum() > 0;
+ for (int i=0; i<_numPoints; i++) {
+ if (_dataPoints[i].hasAltitude()) {return true;}
+ }
+ return false;
}
/**