Ignore:
Timestamp:
2012-03-08T22:02:30+01:00 (8 years ago)
Author:
simon04
Message:

fix #7470 - tune warning of nodes out of downloaded bbox

Location:
trunk/src/org/openstreetmap/josm/command
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/command/Command.java

    r4918 r5060  
    177177    public static boolean checkAndConfirmOutlyingOperation(String operation,
    178178            String dialogTitle, String outsideDialogMessage, String incompleteDialogMessage,
    179             Area area, Collection<? extends OsmPrimitive> primitives, OsmPrimitive ignore) {
     179            Area area, Collection<? extends OsmPrimitive> primitives,
     180            Collection<? extends OsmPrimitive> ignore) {
    180181        boolean outside = false;
    181182        boolean incomplete = false;
    182         if (area != null) {
    183             for (OsmPrimitive osm : primitives) {
    184                 if (osm.isIncomplete()) {
    185                     incomplete = true;
    186                 } else if (isOutlying(osm, area)
    187                         && (ignore == null || !ignore.equals(osm))) {
    188                     outside = true;
    189                 }
    190             }
    191         } else {
    192             for (OsmPrimitive osm : primitives) {
    193                 if (osm.isIncomplete()) {
    194                     incomplete = true;
    195                 }
     183        for (OsmPrimitive osm : primitives) {
     184            if (osm.isIncomplete()) {
     185                incomplete = true;
     186            } else if (area != null && isOutlying(osm, area)
     187                    && (ignore == null || !ignore.contains(osm))) {
     188                outside = true;
    196189            }
    197190        }
  • trunk/src/org/openstreetmap/josm/command/DeleteCommand.java

    r5059 r5060  
    358358        }
    359359
    360         if (!silent && !checkAndConfirmOutlyingDelete(layer, primitivesToDelete, null))
     360        if (!silent && !checkAndConfirmOutlyingDelete(layer,
     361                primitivesToDelete, Utils.filteredCollection(primitivesToDelete, Way.class)))
    361362            return null;
    362363
     
    454455    }
    455456
    456     public static boolean checkAndConfirmOutlyingDelete(OsmDataLayer layer, Collection<? extends OsmPrimitive> primitives, OsmPrimitive ignore) {
     457    public static boolean checkAndConfirmOutlyingDelete(OsmDataLayer layer, Collection<? extends OsmPrimitive> primitives, Collection<? extends OsmPrimitive> ignore) {
    457458        return checkAndConfirmOutlyingDelete(layer.data.getDataSourceArea(), primitives, ignore);
    458459    }
    459460
    460     public static boolean checkAndConfirmOutlyingDelete(Area area, Collection<? extends OsmPrimitive> primitives, OsmPrimitive ignore) {
     461    public static boolean checkAndConfirmOutlyingDelete(Area area, Collection<? extends OsmPrimitive> primitives, Collection<? extends OsmPrimitive> ignore) {
    461462        return Command.checkAndConfirmOutlyingOperation("delete",
    462463                tr("Delete confirmation"),
Note: See TracChangeset for help on using the changeset viewer.