Ignore:
Timestamp:
2016-01-10T20:43:16+01:00 (10 years ago)
Author:
simon04
Message:

see #12325 - Do not exclude the test for non-downloaded datasets, fix unit test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java

    r9349 r9397  
    14681468        @Override
    14691469        protected Collection<Bounds> getBounds() {
    1470             return Main.main.getCurrentDataSet() == null || Main.main.getCurrentDataSet().getDataSourceArea() == null
     1470            return Main.main == null || Main.main.getCurrentDataSet() == null || Main.main.getCurrentDataSet().getDataSourceArea() == null
    14711471                    ? null : Main.main.getCurrentDataSet().getDataSourceBounds();
    14721472        }
     
    14751475        public String toString() {
    14761476            return all ? "allindownloadedarea" : "indownloadedarea";
     1477        }
     1478    }
     1479
     1480    /**
     1481     * Matches objects which are not outside the source area ("downloaded area").
     1482     * Unlink {@link InDataSourceArea} this matches also if no source area is set (e.g., for new layers).
     1483     */
     1484    public static class NotOutsideDataSourceArea extends InDataSourceArea {
     1485
     1486        /**
     1487         * Constructs a new {@code NotOutsideDataSourceArea}.
     1488         */
     1489        public NotOutsideDataSourceArea() {
     1490            super(false);
     1491        }
     1492
     1493        @Override
     1494        protected Collection<Bounds> getBounds() {
     1495            final Collection<Bounds> bounds = super.getBounds();
     1496            return bounds == null || bounds.isEmpty() ? Collections.singleton(Main.getProjection().getWorldBoundsLatLon()) : bounds;
     1497        }
     1498
     1499        @Override
     1500        public String toString() {
     1501            return "NotOutsideDataSourceArea";
    14771502        }
    14781503    }
Note: See TracChangeset for help on using the changeset viewer.