Changeset 6802 in josm for trunk


Ignore:
Timestamp:
2014-02-02T22:11:09+01:00 (11 years ago)
Author:
simon04
Message:

fix #9655 - Merge operations loosing tags (regression of r6770)

Drawback: when combining highway=X with highway=X tunnel=yes, tunnel=yes is auto selected for the conflict resolution (as it was before r6770.

Location:
trunk/src/org/openstreetmap/josm/gui/conflict/tags
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/CombinePrimitiveResolverDialog.java

    r6770 r6802  
    234234    }
    235235
     236    /**
     237     * Replies true if all tag and relation member conflicts have been decided.
     238     *
     239     * @return true if all tag and relation member conflicts have been decided; false otherwise
     240     */
     241    public boolean isResolvedCompletely() {
     242        return getTagConflictResolverModel().isResolvedCompletely()
     243                && getRelationMemberConflictResolverModel().isResolvedCompletely();
     244    }
     245
    236246    protected List<Command> buildTagChangeCommand(OsmPrimitive primitive, TagCollection tc) {
    237247        LinkedList<Command> cmds = new LinkedList<Command>();
     
    517527
    518528        // Resolve tag conflicts if necessary
    519         if (!completeWayTags.isApplicableToPrimitive() || !parentRelations.isEmpty()) {
     529        if (!dialog.isResolvedCompletely()) {
    520530            dialog.setVisible(true);
    521531            if (dialog.isCanceled()) {
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverModel.java

    r5988 r6802  
    3737    private int numConflicts;
    3838    private PropertyChangeSupport support;
     39
     40    /**
     41     * Replies true if each {@link MultiValueResolutionDecision} is decided.
     42     *
     43     * @return true if each {@link MultiValueResolutionDecision} is decided; false
     44     * otherwise
     45     */
     46    public boolean isResolvedCompletely() {
     47        return numConflicts == 0;
     48    }
    3949
    4050    /**
  • trunk/src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolverModel.java

    r6770 r6802  
    258258     */
    259259    public void prepareDefaultTagDecisions() {
    260         // Do not suggest to keep all values in order to reduce the wrong usage of semicolon values, see #9104!
    261         // Do not suggest to keep the single value in order to avoid long highways to become tunnels+bridges+...
    262 
    263         /*
    264260        for (MultiValueResolutionDecision decision: decisions.values()) {
    265261            List<String> values = decision.getValues();
    266262            values.remove("");
    267263            if (values.size() == 1) {
     264                // TODO: Do not suggest to keep the single value in order to avoid long highways to become tunnels+bridges+... (only if both primitives are tagged)
    268265                decision.keepOne(values.get(0));
    269266            } else {
    270                 decision.keepAll();
    271             }
    272         }
    273         */
     267                // Do not suggest to keep all values in order to reduce the wrong usage of semicolon values, see #9104!
     268                //decision.keepAll();
     269            }
     270        }
    274271        rebuild();
    275272    }
Note: See TracChangeset for help on using the changeset viewer.