Changeset 19645 in josm
- Timestamp:
- 2026-10-09T17:06:57+02:00 (7 hours ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/autofilter/AutoFilterManager.java
r19629 r19645 8 8 import java.util.Arrays; 9 9 import java.util.Collection; 10 import java.util.Collections;11 10 import java.util.HashMap; 12 11 import java.util.List; … … 140 139 private synchronized void updateButtons() { 141 140 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 143 144 && enabledRule.getMinZoomLevel() <= Selector.GeneralSelector.scale2level(map.mapView.getDist100Pixel())) { 144 145 // Retrieve the values from current rule visible on screen 145 NavigableSet<Integer> values = getNumericValues(); 146 NavigableSet<Integer> values = getNumericValues(ds); 146 147 // Make sure current auto filter buttons remain visible even if no data is found, to allow user to disable them 147 148 for (AutoFilter currentAutoFilter : currentAutoFilters) { … … 324 325 } 325 326 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) { 331 328 BBox bbox = MainApplication.getMap().mapView.getState().getViewArea().getLatLonBoundsBox().toBBox(); 332 329 NavigableSet<Integer> values = new TreeSet<>();
Note:
See TracChangeset
for help on using the changeset viewer.
