Changeset 7613 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2014-10-13T22:25:59+02:00 (10 years ago)
Author:
Don-vip
Message:

see #8995, fix #10630 - change keyvalue match meaning to "neutral otherwise", add new keyvalue! match mode by default with the old meaning (negative otherwise)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetItems.java

    r7589 r7613  
    254254        /** Positive if key matches, negative otherwise. */
    255255        KEY_REQUIRED("key!"),
     256        /** Positive if key and value matches, neutral otherwise. */
     257        KEY_VALUE("keyvalue"),
    256258        /** Positive if key and value matches, negative otherwise. */
    257         KEY_VALUE("keyvalue");
     259        KEY_VALUE_REQUIRED("keyvalue!");
    258260
    259261        private final String value;
     
    550552                return tags.containsKey(key);
    551553            case KEY_VALUE:
    552                 return tags.containsKey(key) && (getValues().contains(tags.get(key)));
     554                return tags.containsKey(key) && getValues().contains(tags.get(key)) ? true : null;
     555            case KEY_VALUE_REQUIRED:
     556                return tags.containsKey(key) && getValues().contains(tags.get(key));
    553557            default:
    554558                throw new IllegalStateException();
     
    584588        @Override
    585589        public MatchType getDefaultMatch() {
    586             return MatchType.KEY_VALUE;
     590            return MatchType.KEY_VALUE_REQUIRED;
    587591        }
    588592
Note: See TracChangeset for help on using the changeset viewer.