Changeset 16199 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
- Timestamp:
- 2020-03-23T14:24:59+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
r16191 r16199 35 35 import org.openstreetmap.josm.gui.mappaint.Environment; 36 36 import org.openstreetmap.josm.gui.mappaint.Range; 37 import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.IndexCondition; 37 38 import org.openstreetmap.josm.gui.mappaint.mapcss.ConditionFactory.OpenEndPseudoClassCondition; 38 39 import org.openstreetmap.josm.tools.CheckParameterUtil; … … 220 221 return; 221 222 } 222 for (int i = 0; i < count; i++) { 223 if (getter.apply(i).equals(e.osm) && link.matches(e.withParentAndIndexAndLinkContext(parent, i, count))) { 223 // see #18964 224 int step = firstAndLastOnly() ? count - 1 : 1; 225 for (int i = 0; i < count; i += step) { 226 if (getter.apply(i).equals(e.osm) 227 && link.matches(e.withParentAndIndexAndLinkContext(parent, i, count))) { 224 228 e.parent = parent; 225 229 e.index = i; … … 228 232 } 229 233 } 234 } 235 236 private boolean firstAndLastOnly() { 237 for (Condition c : link.conds) { 238 if (!(c instanceof IndexCondition) || !((IndexCondition) c).isFirstOrLast) { 239 return false; 240 } 241 } 242 return true; 230 243 } 231 244
Note:
See TracChangeset
for help on using the changeset viewer.