aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2013-01-26 22:58:42 +0100
committerSamuel Tardieu <sam@rfc1149.net>2013-01-26 22:58:42 +0100
commit1139fc83197316f0ababb5cd365cbb440b632e3b (patch)
treea0af756ff2f71c333c0ca187607522aa8beb0754
parent2f541d3b40e67e03c540f4e10dccf0384854fd0e (diff)
downloadcgeo-1139fc83197316f0ababb5cd365cbb440b632e3b.zip
cgeo-1139fc83197316f0ababb5cd365cbb440b632e3b.tar.gz
cgeo-1139fc83197316f0ababb5cd365cbb440b632e3b.tar.bz2
0 is a valid waypoint id
-rw-r--r--main/src/cgeo/geocaching/cgCache.java6
-rw-r--r--main/src/cgeo/geocaching/maps/CachesOverlay.java2
2 files changed, 4 insertions, 4 deletions
diff --git a/main/src/cgeo/geocaching/cgCache.java b/main/src/cgeo/geocaching/cgCache.java
index b120581..34263b1 100644
--- a/main/src/cgeo/geocaching/cgCache.java
+++ b/main/src/cgeo/geocaching/cgCache.java
@@ -1,8 +1,8 @@
package cgeo.geocaching;
-import cgeo.geocaching.cgData.StorageLocation;
import cgeo.geocaching.activity.ActivityMixin;
import cgeo.geocaching.activity.IAbstractActivity;
+import cgeo.geocaching.cgData.StorageLocation;
import cgeo.geocaching.connector.ConnectorFactory;
import cgeo.geocaching.connector.IConnector;
import cgeo.geocaching.connector.capability.ISearchByCenter;
@@ -1142,7 +1142,7 @@ public class cgCache implements ICache, IWaypoint {
public boolean addOrChangeWaypoint(final Waypoint waypoint, boolean saveToDatabase) {
waypoint.setGeocode(geocode);
- if (waypoint.getId() <= 0) { // this is a new waypoint
+ if (waypoint.getId() < 0) { // this is a new waypoint
waypoints.add(waypoint);
if (waypoint.isFinalWithCoords()) {
finalDefined = true;
@@ -1223,7 +1223,7 @@ public class cgCache implements ICache, IWaypoint {
if (waypoint == null) {
return false;
}
- if (waypoint.getId() <= 0) {
+ if (waypoint.getId() < 0) {
return false;
}
if (waypoint.isUserDefined()) {
diff --git a/main/src/cgeo/geocaching/maps/CachesOverlay.java b/main/src/cgeo/geocaching/maps/CachesOverlay.java
index fe1a19b..ce519f4 100644
--- a/main/src/cgeo/geocaching/maps/CachesOverlay.java
+++ b/main/src/cgeo/geocaching/maps/CachesOverlay.java
@@ -237,7 +237,7 @@ public class CachesOverlay extends AbstractItemizedOverlay {
return true;
}
- if (coordinate.getCoordType() != null && coordinate.getCoordType().equalsIgnoreCase("waypoint") && coordinate.getId() > 0) {
+ if (coordinate.getCoordType() != null && coordinate.getCoordType().equalsIgnoreCase("waypoint") && coordinate.getId() >= 0) {
CGeoMap.markCacheAsDirty(coordinate.getGeocode());
WaypointPopup.startActivity(context, coordinate.getId(), coordinate.getGeocode());
} else {