Changeset 3153 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2010-03-23T21:09:17+01:00 (15 years ago)
Author:
jttt
Message:

Return copy of bbox in Way.getBBox (to make sure internal copy won't be modified)

Location:
trunk/src/org/openstreetmap/josm
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/AbstractMergeAction.java

    r3083 r3153  
    3030     */
    3131    static public class LayerListCellRenderer extends DefaultListCellRenderer {
    32 
    33         protected boolean isActiveLayer(Layer layer) {
    34             if (Main.isDisplayingMapView()) return false;
    35             return Main.map.mapView.getActiveLayer() == layer;
    36         }
    3732
    3833        @Override
  • trunk/src/org/openstreetmap/josm/data/osm/BBox.java

    r3083 r3153  
    2222        add(a);
    2323        add(b);
     24    }
     25
     26    public BBox(BBox copy) {
     27        this.xmin = copy.xmin;
     28        this.xmax = copy.xmax;
     29        this.ymin = copy.ymin;
     30        this.ymax = copy.ymax;
    2431    }
    2532
  • trunk/src/org/openstreetmap/josm/data/osm/Relation.java

    r3117 r3153  
    334334    @Override
    335335    public BBox getBBox() {
     336        if (members.isEmpty())
     337            return new BBox(0, 0, 0, 0);
    336338        if (getDataSet() == null)
    337339            return calculateBBox(new HashSet<PrimitiveId>());
     
    339341            if (bbox == null) {
    340342                bbox = calculateBBox(new HashSet<PrimitiveId>());
    341                 if (bbox == null) {
    342                     bbox = new BBox(0, 0, 0, 0); // No members
    343                 }
    344             }
    345             return  bbox;
     343            }
     344            return new BBox(bbox);
    346345        }
    347346    }
  • trunk/src/org/openstreetmap/josm/data/osm/Way.java

    r3117 r3153  
    401401            bbox = new BBox(this);
    402402        }
    403         return bbox;
     403        return new BBox(bbox);
    404404    }
    405405
Note: See TracChangeset for help on using the changeset viewer.