+ // Re-attach / Re-insert photo into list if necessary\r
+ if (_point.getPhoto() != null && _photoIndex > -1)\r
+ {\r
+ // Check if photo is still in list\r
+ if (!inTrackInfo.getPhotoList().contains(_point.getPhoto()))\r
+ {\r
+ // photo has been removed - need to reinsert\r
+ inTrackInfo.getPhotoList().addPhoto(_point.getPhoto(), _photoIndex);\r
+ }\r
+ // Ensure that photo is associated with point\r
+ if (_point.getPhoto().getDataPoint() != _point) {\r
+ _point.getPhoto().setDataPoint(_point);\r
+ }\r
+ }\r
+ // Re-add audio as well if necessary\r
+ if (_point.getAudio() != null && _audioIndex > -1)\r
+ {\r
+ // add audio object to list\r
+ inTrackInfo.getAudioList().addAudio(_point.getAudio(), _audioIndex);\r
+ _point.getAudio().setDataPoint(_point);\r
+ }\r
+ // Restore previous status of following track point if necessary\r
+ if (!_segmentStart)\r
+ {\r
+ // Deletion of point can only set following point to true, so only need to set it back to false\r
+ DataPoint nextTrackPoint = inTrackInfo.getTrack().getNextTrackPoint(_pointIndex + 1);\r
+ if (nextTrackPoint != null) {\r
+ nextTrackPoint.setSegmentStart(false);\r
+ }\r
+ }\r
+ // If there's a current point or range selected, maybe need to adjust start and/or end\r
+ modifySelection(inTrackInfo, _pointIndex, _pointIndex);\r