Changeset 8976 in josm


Ignore:
Timestamp:
2015-11-02T10:21:34+01:00 (9 years ago)
Author:
simon04
Message:

fix #12016 - History dialog sometimes incorrectly shows a way as reversed

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/history/TwoColumnDiff.java

    r8840 r8976  
    7979        Diff.Change scriptReversed = new Diff(referenceReversed, current).diff_2(false);
    8080        if (scriptReversed == null /* reference and current are identical */
    81                 || script != null && scriptReversed.deleted + scriptReversed.inserted < script.deleted + script.inserted) {
     81                || script != null && scriptReversed.getTotalNumberOfChanges() < script.getTotalNumberOfChanges()) {
    8282            this.referenceReversed = true;
    8383            twoColumnDiffFromScript(scriptReversed, referenceReversed, current, true);
  • trunk/src/org/openstreetmap/josm/tools/Diff.java

    r8928 r8976  
    570570        }
    571571
     572        /**
     573         * Returns the number of insertions and deletions of this change as well as
     574         * (recursively) the changes linked via {@link #link}.
     575         */
     576        public int getTotalNumberOfChanges() {
     577            return inserted + deleted + (link != null ? link.getTotalNumberOfChanges() : 0);
     578        }
     579
    572580        @Override
    573581        public String toString() {
Note: See TracChangeset for help on using the changeset viewer.