Changeset 4011 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Expression.java
- Timestamp:
- 2011-03-30T22:25:20+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Expression.java
r4008 r4011 17 17 import org.openstreetmap.josm.actions.search.SearchCompiler.ParseError; 18 18 import org.openstreetmap.josm.data.osm.OsmPrimitive; 19 import org.openstreetmap.josm.data.osm.Relation;20 19 import org.openstreetmap.josm.gui.mappaint.Cascade; 21 20 import org.openstreetmap.josm.gui.mappaint.Environment; … … 174 173 } 175 174 176 // FIXME: respect parent selector chain177 175 public String parent_tag(String key) { 178 for (Relation parent: OsmPrimitive.getFilteredList(env.osm.getReferrers(), Relation.class)) { 179 String value = parent.get(key); 180 if (value != null) return value; 181 } 182 return null; 176 if (env.getMatchingReferrers() == null) { 177 // we don't have a matched parent, so just search all referrers 178 for (OsmPrimitive parent : env.osm.getReferrers()) { 179 String value = parent.get(key); 180 if (value != null) 181 return value; 182 } 183 return null; 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); 183 190 } 184 191
Note:
See TracChangeset
for help on using the changeset viewer.
