Changeset 19645 in josm


Ignore:
Timestamp:
2026-10-09T17:06:57+02:00 (73 minutes ago)
Author:
gaben
Message:

fix #24863 - keep auto filter buttons unchanged while the data layer is uploaded

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/autofilter/AutoFilterManager.java

    r19629 r19645  
    88import java.util.Arrays;
    99import java.util.Collection;
    10 import java.util.Collections;
    1110import java.util.HashMap;
    1211import java.util.List;
    … …  
    140139    private synchronized void updateButtons() {
    141140        MapFrame map = MainApplication.getMap();
    142         if (enabledRule != null && map != null
     141        // The active data set is null while the data layer is uploaded, keep the buttons as they are
     142        DataSet ds = MainApplication.getLayerManager().getActiveDataSet();
     143        if (enabledRule != null && map != null && ds != null
    143144                && enabledRule.getMinZoomLevel() <= Selector.GeneralSelector.scale2level(map.mapView.getDist100Pixel())) {
    144145            // Retrieve the values from current rule visible on screen
    145             NavigableSet<Integer> values = getNumericValues();
     146            NavigableSet<Integer> values = getNumericValues(ds);
    146147            // Make sure current auto filter buttons remain visible even if no data is found, to allow user to disable them
    147148            for (AutoFilter currentAutoFilter : currentAutoFilters) {
    … …  
    324325    }
    325326
    326     private synchronized NavigableSet<Integer> getNumericValues() {
    327         DataSet ds = MainApplication.getLayerManager().getActiveDataSet();
    328         if (ds == null) {
    329             return Collections.emptyNavigableSet();
    330         }
     327    private synchronized NavigableSet<Integer> getNumericValues(DataSet ds) {
    331328        BBox bbox = MainApplication.getMap().mapView.getState().getViewArea().getLatLonBoundsBox().toBBox();
    332329        NavigableSet<Integer> values = new TreeSet<>();
Note: See TracChangeset for help on using the changeset viewer.