Changeset 14932 in josm for trunk/src/org


Ignore:
Timestamp:
2019-03-26T00:07:36+01:00 (6 years ago)
Author:
Don-vip
Message:

see #15051, fix #17522 - crash in filter dialog caused by r14927 (patch by taylor.smock)

Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java

    r14927 r14932  
    173173     * @param initialValues A set of initial values needed in order to initialize the search dialog.
    174174     *                      If is {@code null}, then default settings are used.
    175      * @return Returns {@link SearchAction} object containing parameters of the search.
     175     * @return Returns new {@link SearchSetting} object containing parameters of the search.
    176176     */
    177177    public static SearchSetting showSearchDialog(SearchSetting initialValues) {
  • trunk/src/org/openstreetmap/josm/data/osm/Filter.java

    r13205 r14932  
    4444        super();
    4545        mode = SearchMode.add;
     46    }
     47
     48    /**
     49     * Constructs a new {@code Filter} from a {@code SearchSetting}
     50     * @param setting {@code SearchSetting} to construct information from
     51     * @since 14932
     52     */
     53    public Filter(SearchSetting setting) {
     54        super(setting);
    4655    }
    4756
  • trunk/src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java

    r14895 r14932  
    4141import org.openstreetmap.josm.data.osm.event.TagsChangedEvent;
    4242import org.openstreetmap.josm.data.osm.event.WayNodesChangedEvent;
     43import org.openstreetmap.josm.data.osm.search.SearchSetting;
    4344import org.openstreetmap.josm.gui.MainApplication;
    4445import org.openstreetmap.josm.gui.MapFrame;
     
    142143            @Override
    143144            public void actionPerformed(ActionEvent e) {
    144                 Filter filter = (Filter) SearchAction.showSearchDialog(new Filter());
    145                 if (filter != null) {
    146                     filterModel.addFilter(filter);
     145                SearchSetting searchSetting = SearchAction.showSearchDialog(new Filter());
     146                if (searchSetting != null) {
     147                    filterModel.addFilter(new Filter(searchSetting));
    147148                }
    148149            }
     
    160161                if (index < 0) return;
    161162                Filter f = filterModel.getFilter(index);
    162                 Filter filter = (Filter) SearchAction.showSearchDialog(f);
    163                 if (filter != null) {
    164                     filterModel.setFilter(index, filter);
     163                SearchSetting searchSetting = SearchAction.showSearchDialog(f);
     164                if (searchSetting != null) {
     165                    filterModel.setFilter(index, new Filter(searchSetting));
    165166                }
    166167            }
Note: See TracChangeset for help on using the changeset viewer.