Changeset 5060 in josm


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

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

Location:
trunk/src/org/openstreetmap/josm
Files:
3 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"),
  • trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java

    r4874 r5060  
    77import java.util.ArrayList;
    88import java.util.Collection;
     9import java.util.Collections;
    910import java.util.HashMap;
    1011import java.util.Iterator;
     
    384385        }
    385386
    386         if (DeleteCommand.checkAndConfirmOutlyingDelete(Main.main.getCurrentDataSet().getDataSourceArea(), nodes, target))
     387        if (DeleteCommand.checkAndConfirmOutlyingDelete(Main.main.getCurrentDataSet().getDataSourceArea(), nodes, Collections.singleton(target)))
    387388            return MergeNodesAction.mergeNodes(Main.main.getEditLayer(), nodes, target);
    388389
Note: See TracChangeset for help on using the changeset viewer.