Changeset 14323 in josm for trunk/src/org


Ignore:
Timestamp:
2018-10-13T18:45:34+02:00 (6 years ago)
Author:
Don-vip
Message:

see #16816 - don't display version = 0 for new objects

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/DefaultNameFormatter.java

    r14315 r14323  
    121121     */
    122122    protected void decorateNameWithId(StringBuilder name, IPrimitive primitive) {
     123        int version = primitive.getVersion();
    123124        if (Config.getPref().getBoolean("osm-primitives.showid")) {
    124125            long id = Config.getPref().getBoolean("osm-primitives.showid.new-primitives") ?
    125126                    primitive.getUniqueId() : primitive.getId();
    126             if (Config.getPref().getBoolean("osm-primitives.showversion")) {
    127                 name.append(tr(" [id: {0}, v{1}]", id, primitive.getVersion()));
     127            if (Config.getPref().getBoolean("osm-primitives.showversion") && version > 0) {
     128                name.append(tr(" [id: {0}, v{1}]", id, version));
    128129            } else {
    129130                name.append(tr(" [id: {0}]", id));
    130131            }
    131132        } else if (Config.getPref().getBoolean("osm-primitives.showversion")) {
    132             name.append(tr(" [v{0}]", primitive.getVersion()));
     133            name.append(tr(" [v{0}]", version));
    133134        }
    134135    }
Note: See TracChangeset for help on using the changeset viewer.