Changeset 2996 in josm for trunk


Ignore:
Timestamp:
2010-02-16T09:30:28+01:00 (10 years ago)
Author:
jttt
Message:

Fix #4406 tags disapear: merging node with ID:0 and tag to existing node without tags

Location:
trunk/src/org/openstreetmap/josm
Files:
4 edited

Legend:

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

    r2512 r2996  
    110110            Tag other = (Tag) obj;
    111111            return key.equals(other.getKey()) && value.equals(other.getValue());
    112         } else {
     112        } else
    113113            return false;
    114         }
    115114    }
    116115
  • trunk/src/org/openstreetmap/josm/data/osm/TagCollection.java

    r2990 r2996  
    117117    }
    118118
    119     private HashSet<Tag> tags;
     119    private final HashSet<Tag> tags = new HashSet<Tag>();
    120120
    121121    /**
     
    123123     */
    124124    public TagCollection() {
    125         tags = new HashSet<Tag>();
    126125    }
    127126
     
    133132     */
    134133    public TagCollection(TagCollection other) {
    135         this();
    136134        if (other != null) {
    137135            tags.addAll(other.tags);
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/CombinePrimitiveResolverDialog.java

    r2779 r2996  
    222222        List<Command> cmds = new LinkedList<Command>();
    223223
    224         if (getTagConflictResolverModel().getNumDecisions() > 0) {
    225             TagCollection tc = getTagConflictResolverModel().getResolution();
    226             cmds.addAll(buildTagChangeCommand(targetPrimitive, tc));
     224        TagCollection allResolutions = getTagConflictResolverModel().getAllResolutions();
     225        if (allResolutions.size() > 0) {
     226            cmds.addAll(buildTagChangeCommand(targetPrimitive, allResolutions));
    227227        }
    228228        if (targetPrimitive.get("created_by") != null) {
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolverModel.java

    r2990 r2996  
    182182    }
    183183
     184    //TODO Should this method work with all decisions or only with displayed decisions? For MergeNodes it should be
     185    //all decisions, but this method is also used on other places, so I've made new method just for MergeNodes
    184186    public TagCollection getResolution() {
    185187        TagCollection tc = new TagCollection();
    186188        for (String key: displayedKeys) {
    187189            tc.add(decisions.get(key).getResolution());
     190        }
     191        return tc;
     192    }
     193
     194    public TagCollection getAllResolutions() {
     195        TagCollection tc = new TagCollection();
     196        for (MultiValueResolutionDecision value: decisions.values()) {
     197            tc.add(value.getResolution());
    188198        }
    189199        return tc;
Note: See TracChangeset for help on using the changeset viewer.