Changeset 5624 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2012-12-19T14:21:31+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
r5614 r5624 54 54 import org.openstreetmap.josm.data.osm.Node; 55 55 import org.openstreetmap.josm.data.osm.OsmPrimitive; 56 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 56 57 import org.openstreetmap.josm.data.osm.OsmUtils; 57 58 import org.openstreetmap.josm.data.osm.Relation; … … 121 122 } 122 123 123 public static PresetType forPrimitiveType( org.openstreetmap.josm.data.osm.OsmPrimitiveType type) {124 public static PresetType forPrimitiveType(OsmPrimitiveType type) { 124 125 switch (type) { 125 126 case NODE: … … 1589 1590 1590 1591 public String suggestRoleForOsmPrimitive(OsmPrimitive osm) { 1591 if (roles == null) {1592 return null;1593 }1594 for (Role i : roles.roles) {1595 if (i.memberExpression != null && i.memberExpression.match(osm)) {1596 return i.key;1592 if (roles != null && osm != null) { 1593 for (Role i : roles.roles) { 1594 if (i.memberExpression != null && i.memberExpression.match(osm) 1595 && (i.types == null || i.types.isEmpty() || i.types.contains(PresetType.forPrimitive(osm)) )) { 1596 return i.key; 1597 } 1597 1598 } 1598 1599 }
Note:
See TracChangeset
for help on using the changeset viewer.