[josm-dev] Patch: fixes for delete

Gabriel Ebner ge at gabrielebner.at
Mon Dec 17 14:07:18 GMT 2007


On Mon, Dec 17, 2007 at 03:52:30PM +0200, Lauri Hahne wrote:
> Index: C:/lauri/deve/trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
> ===================================================================
> --- C:/lauri/deve/trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java	(revision 494)
> +++ C:/lauri/deve/trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java	(working copy)
> @@ -113,7 +113,7 @@
>  				} else if (ctrl) {
>  					c = deleteWithReferences(Collections.singleton((OsmPrimitive)ws.way));
>  				} else {
> -					c = delete(Collections.singleton((OsmPrimitive)ws.way), alt);
> +					c = delete(Collections.singleton((OsmPrimitive)ws.way), true);

This should probably be !alt, so you can still remove a way without deleting
the nodes too.

> @@ -183,7 +183,7 @@
>  			for (OsmPrimitive osm : del) {
>  				if (osm instanceof Way) {
>  					for (Node n : ((Way)osm).nodes) {
> -						if (!n.tagged) {
> +						if (!n.tagged || (n.keys.size()==1 && n.keys.containsKey("created_by"))) {

This is a no-op since n.tagged is set to false when the only tag is a created_by
tag.

> -	public void mouseDragged(MouseEvent e) {
> +	@Override public void mouseDragged(MouseEvent e) {
> -	public void mouseWheelMoved(MouseWheelEvent e) {
> +	@Override public void mouseWheelMoved(MouseWheelEvent e) {
> -	public void mouseMoved(MouseEvent e) {}
> +	@Override public void mouseMoved(MouseEvent e) {}

This fails to compile in java 5.

  Gabriel.




More information about the josm-dev mailing list