Changeset 4069 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Expression.java
- Timestamp:
- 2011-05-02T23:47:19+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Expression.java
r4011 r4069 174 174 175 175 public String parent_tag(String key) { 176 if (env. getMatchingReferrers()== null) {176 if (env.parent == null) { 177 177 // we don't have a matched parent, so just search all referrers 178 178 for (OsmPrimitive parent : env.osm.getReferrers()) { … … 183 183 return null; 184 184 } 185 if (env.getMatchingReferrers().isEmpty()) 186 return null; 187 // use always the first matching referrer to have consistency 188 // in an expression and declaration block 189 return env.getMatchingReferrers().iterator().next().get(key); 185 return env.parent.get(key); 190 186 } 191 187 192 188 public boolean has_tag_key(String key) { 193 189 return env.osm.hasKey(key); 190 } 191 192 public Float index() { 193 if (env.index == null) 194 return null; 195 return new Float(env.index + 1); 196 } 197 198 public String role() { 199 return env.getRole(); 194 200 } 195 201
Note:
See TracChangeset
for help on using the changeset viewer.