Changeset 27698 in osm


Ignore:
Timestamp:
2012-02-03T16:49:50+01:00 (13 years ago)
Author:
joshdoe
Message:

utilsplugin2: Fix #7295, allow Replace Geometry action with ways which share tagged nodes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/dumbutils/ReplaceGeometryAction.java

    r27645 r27698  
    198198        }
    199199       
    200         if (hasImportantNode(way)) {
    201             JOptionPane.showMessageDialog(Main.parent,
    202                     tr("The way to be replaced cannot have any nodes with properties or relation memberships."),
     200        if (hasImportantNode(geometry, way)) {
     201            JOptionPane.showMessageDialog(Main.parent,
     202                    tr("The way to be replaced cannot have any nodes with properties or relation memberships unless they belong to both ways."),
    203203                    TITLE, JOptionPane.WARNING_MESSAGE);
    204204            return;
     
    297297     * @return
    298298     */
    299     protected boolean hasImportantNode(Way way) {
     299    protected boolean hasImportantNode(Way geometry, Way way) {
    300300        for (Node n : way.getNodes()) {
     301            // if original and replacement way share a node, it's safe to replace
     302            if (geometry.containsNode(n)) {
     303                continue;
     304            }
    301305            //TODO: if way is connected to other ways, warn or disallow?
    302306            for (OsmPrimitive o : n.getReferrers()) {
Note: See TracChangeset for help on using the changeset viewer.