Ignore:
Timestamp:
2009-12-28T09:44:19+01:00 (15 years ago)
Author:
guggis
Message:

'Fixed JOSM ticket #4235 - Validation layer is not removed when data layers are removed'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/OSMValidatorPlugin.java

    r19072 r19224  
    1414import java.util.Collection;
    1515import java.util.HashMap;
    16 import java.util.Iterator;
    17 import java.util.LinkedList;
    1816import java.util.List;
    1917import java.util.Map;
     
    291289    }
    292290
     291    /* -------------------------------------------------------------------------- */
     292    /* interface LayerChangeListener                                              */
     293    /* -------------------------------------------------------------------------- */
    293294    public void activeLayerChange(Layer oldLayer, Layer newLayer) {
    294295        if (newLayer instanceof OsmDataLayer) {
     
    306307
    307308    public void layerRemoved(Layer oldLayer) {
     309        if (oldLayer == errorLayer) {
     310                errorLayer = null;
     311                return;
     312        }
    308313        layerErrors.remove(oldLayer);
     314        if (Main.map.mapView.getLayersOfType(OsmDataLayer.class).isEmpty()) {
     315                if (errorLayer != null) {
     316                        Main.map.mapView.removeLayer(errorLayer);
     317                }
     318        }
    309319    }
    310320}
Note: See TracChangeset for help on using the changeset viewer.