Ignore:
Timestamp:
2009-07-09T18:54:09+02:00 (15 years ago)
Author:
Gubaer
Message:

fixed #2888: Check for deleted elements should ignore incomplete elements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/DataSet.java

    r1690 r1756  
    313313    }
    314314
     315    /**
     316     * Replies the set of ids of all complete primitivies (i.e. those with
     317     * ! primitive.incomplete)
     318     *
     319     * @return the set of ids of all complete primitivies
     320     */
     321    public Set<Long> getCompletePrimitiveIds() {
     322        HashSet<Long> ret = new HashSet<Long>();
     323        for (OsmPrimitive primitive : nodes) {
     324            if (!primitive.incomplete) {
     325                ret.add(primitive.id);
     326            }
     327        }
     328        for (OsmPrimitive primitive : ways) {
     329            if (! primitive.incomplete) {
     330                ret.add(primitive.id);
     331            }
     332        }
     333        for (OsmPrimitive primitive : relations) {
     334            if (! primitive.incomplete) {
     335                ret.add(primitive.id);
     336            }
     337        }
     338        return ret;
     339    }
     340
    315341    protected void deleteWay(Way way) {
    316342        way.nodes.clear();
Note: See TracChangeset for help on using the changeset viewer.