try fix bug of "Ad as last waypoint" code

This commit is contained in:
sonora 2013-06-10 14:50:10 +02:00
parent 34297b091f
commit 5e886ea3a9

View file

@ -1297,9 +1297,12 @@ public class MapActivityActions implements DialogProvider {
} else if(which == 2) {
int sz = targetPointsHelper.getIntermediatePoints().size();
LatLon pt = targetPointsHelper.getPointToNavigate();
settings.insertIntermediatePoint(pt.getLatitude(), pt.getLongitude(),
settings.getPointNavigateDescription(), sz, true);
settings.setPointToNavigate(lat, lon, true, name);
settings.insertIntermediatePoint(lat, lon, name, sz, true);
settings.setPointToNavigate(pt.getLatitude(), pt.getLongitude(), true, settings.getPointNavigateDescription());
// I believe the following prior code was buggy, Hardy 2013-06-10:
//settings.insertIntermediatePoint(pt.getLatitude(), pt.getLongitude(),
// settings.getPointNavigateDescription(), sz, true);
//settings.setPointToNavigate(lat, lon, true, name);
} else {
settings.insertIntermediatePoint(lat, lon, name, 0, true);
}