Changeset 15817 in josm


Ignore:
Timestamp:
2020-02-05T22:09:38+01:00 (3 weeks ago)
Author:
simon04
Message:

AutoFilter: avoid parsing value from CompiledFilter

Location:
trunk/src/org/openstreetmap/josm/gui/autofilter
Files:
2 edited

Legend:

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

    r12474 r15817  
    33
    44import java.util.Objects;
    5 
    6 import org.openstreetmap.josm.data.osm.Filter;
    75
    86/**
     
    1311    private final String label;
    1412    private final String description;
    15     private final Filter filter;
     13    private final AutoFilterManager.CompiledFilter filter;
    1614
    1715    /**
     
    2119     * @param filter associated filter
    2220     */
    23     public AutoFilter(String label, String description, Filter filter) {
     21    public AutoFilter(String label, String description, AutoFilterManager.CompiledFilter filter) {
    2422        this.label = label;
    2523        this.description = description;
     
    4745     * @return the filter
    4846     */
    49     public Filter getFilter() {
     47    public AutoFilterManager.CompiledFilter getFilter() {
    5048        return filter;
    5149    }
  • trunk/src/org/openstreetmap/josm/gui/autofilter/AutoFilterManager.java

    r15764 r15817  
    149149            // Make sure current auto filter button remains visible even if no data is found, to allow user to disable it
    150150            if (currentAutoFilter != null) {
    151                 values.add(currentAutoFilter.getFilter().text.split("=")[1]);
     151                values.add(currentAutoFilter.getFilter().value);
    152152            }
    153153            if (!values.equals(buttons.keySet())) {
     
    186186        MapView mapView = MainApplication.getMap().mapView;
    187187        for (final String value : values.descendingSet()) {
    188             Filter filter = new CompiledFilter(enabledRule.getKey(), value);
     188            CompiledFilter filter = new CompiledFilter(enabledRule.getKey(), value);
    189189            String label = enabledRule.getValueFormatter().apply(value);
    190190            AutoFilter autoFilter = new AutoFilter(label, filter.text, filter);
Note: See TracChangeset for help on using the changeset viewer.