Ticket #11150: 11150.patch

File 11150.patch, 2.7 KB (added by simon04, 10 years ago)
  • data/validator/combinations.mapcss

    diff --git a/data/validator/combinations.mapcss b/data/validator/combinations.mapcss
    index 58809d7..1670223 100644
    a b way[highway][natural],  
    258258/* see #10471 */
    259259way[waterway] > node[ford?] { set ford_on_waterway; }
    260260way[highway] > node[ford?] { set ford_on_highway; }
    261 node[ford?]!.ford_on_waterway, node[ford?]!.ford_on_highway {
     261node[ford?]:indownloadedarea!.ford_on_waterway, node[ford?]:indownloadedarea!.ford_on_highway {
    262262    throwWarning: tr("{0} should be on the node where {1} and {2} intersect", "ford", "highway", "waterway");
    263263}
    264264
  • src/org/openstreetmap/josm/actions/search/SearchCompiler.java

    diff --git a/src/org/openstreetmap/josm/actions/search/SearchCompiler.java b/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
    index 5e64226..3d06193 100644
    a b public class SearchCompiler {  
    12191219    /**
    12201220     * Matches objects within source area ("downloaded area").
    12211221     */
    1222     private static class InDataSourceArea extends InArea {
     1222    public static class InDataSourceArea extends InArea {
    12231223
    12241224        public InDataSourceArea(boolean all) {
    12251225            super(all);
    public class SearchCompiler {  
    12271227
    12281228        @Override
    12291229        protected Bounds getBounds() {
    1230             return new Bounds(Main.main.getCurrentDataSet().getDataSourceArea().getBounds2D());
     1230            return Main.main.getCurrentDataSet() == null || Main.main.getCurrentDataSet().getDataSourceArea() == null
     1231                    ? null : new Bounds(Main.main.getCurrentDataSet().getDataSourceArea().getBounds2D());
    12311232        }
    12321233    }
    12331234
  • src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java

    diff --git a/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java b/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java
    index 0b1ec34..3214354 100644
    a b import java.util.Set;  
    99import java.util.regex.Pattern;
    1010
    1111import org.openstreetmap.josm.Main;
     12import org.openstreetmap.josm.actions.search.SearchCompiler;
    1213import org.openstreetmap.josm.data.osm.Node;
    1314import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1415import org.openstreetmap.josm.data.osm.Relation;
    public abstract class Condition {  
    418419            case "open_end":
    419420                // handling at org.openstreetmap.josm.gui.mappaint.mapcss.Selector.ChildOrParentSelector.MultipolygonOpenEndFinder
    420421                return true;
     422            case "indownloadedarea":
     423                return new SearchCompiler.InDataSourceArea(false).evaluate(e.osm);
    421424            }
    422425            return false;
    423426        }