diff options
Diffstat (limited to 'main/src/cgeo/geocaching/Waypoint.java')
| -rw-r--r-- | main/src/cgeo/geocaching/Waypoint.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/main/src/cgeo/geocaching/Waypoint.java b/main/src/cgeo/geocaching/Waypoint.java index e1a8b2f..facd914 100644 --- a/main/src/cgeo/geocaching/Waypoint.java +++ b/main/src/cgeo/geocaching/Waypoint.java @@ -4,6 +4,7 @@ import cgeo.geocaching.enumerations.WaypointType; import cgeo.geocaching.geopoint.Geopoint; import org.apache.commons.lang3.StringUtils; +import org.eclipse.jdt.annotation.NonNull; import java.util.Comparator; import java.util.HashMap; @@ -93,11 +94,18 @@ public class Waypoint implements IWaypoint { if (newPrefixes.containsKey(prefix)) { newPrefixes.get(prefix).merge(oldWaypoint); } else if (oldWaypoint.isUserDefined() || forceMerge) { - newPoints.add(oldWaypoint); + // personal note waypoints should always be taken from the new list only + if (!isPersonalNoteWaypoint(oldWaypoint)) { + newPoints.add(oldWaypoint); + } } } } + private static boolean isPersonalNoteWaypoint(final @NonNull Waypoint waypoint) { + return StringUtils.startsWith(waypoint.getName(), CgeoApplication.getInstance().getString(R.string.cache_personal_note) + " "); + } + public boolean isUserDefined() { return own || WaypointType.OWN == waypointType; } |
