Changeset 35236 in osm for applications/editors


Ignore:
Timestamp:
2019-11-25T20:33:01+01:00 (5 years ago)
Author:
holgermappt
Message:

Deactivate UntaggedGeoImageLayerAction if there are just tagged or untagged images, see #josm18357

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/photoadjust/src/org/openstreetmap/josm/plugins/photoadjust/UntaggedGeoImageLayerAction.java

    r34786 r35236  
    6565
    6666    /**
    67      * Check if there is any image without coordinates.
     67     * Determine if the action should be enabled. That is the case if there is
     68     * any image without coordinates and any image with coordinates.
    6869     * @param layer geo image layer
    6970     * @return {@code true} if there is any image without coordinates
     
    7172    private static boolean enabled(GeoImageLayer layer) {
    7273        if (layer != null) {
     74            boolean hasNoPos = false;
     75            boolean hasPos = false;
    7376            for (ImageEntry img: layer.getImages()) {
    7477                if (img.getPos() == null) {
     78                    hasNoPos = true;
     79                } else {
     80                    hasPos = true;
     81                }
     82                if (hasNoPos && hasPos) {
    7583                    return true;
    7684                }
Note: See TracChangeset for help on using the changeset viewer.