Changeset 8510 in josm for trunk/src/org/openstreetmap/josm/gui/history/TwoColumnDiff.java
- Timestamp:
- 2015-06-20T23:42:21+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/history/TwoColumnDiff.java
r8318 r8510 32 32 33 33 public enum DiffItemType { 34 INSERTED(new Color(0xDD, 0xFF, 0xDD)), DELETED(new Color(255,197,197)), CHANGED(new Color(255,234,213)), 35 SAME(new Color(234,234,234)), EMPTY(new Color(234,234,234)); 34 INSERTED(new Color(0xDD, 0xFF, 0xDD)), 35 DELETED(new Color(255, 197, 197)), 36 CHANGED(new Color(255, 234, 213)), 37 SAME(new Color(234, 234, 234)), 38 EMPTY(new Color(234, 234, 234)); 36 39 37 40 private final Color color; … … 39 42 this.color = color; 40 43 } 44 41 45 public Color getColor() { 42 46 return color; … … 91 95 int ib = 0; 92 96 93 while (script != null) {97 while (script != null) { 94 98 int deleted = script.deleted; 95 99 int inserted = script.inserted; 96 while (ia < script.line0 && ib < script.line1){100 while (ia < script.line0 && ib < script.line1) { 97 101 Item cell = new Item(DiffItemType.SAME, a[ia]); 98 102 referenceDiff.add(cell); … … 102 106 } 103 107 104 while (inserted > 0 || deleted > 0) {105 if (inserted > 0 && deleted > 0) {108 while (inserted > 0 || deleted > 0) { 109 if (inserted > 0 && deleted > 0) { 106 110 referenceDiff.add(new Item(DiffItemType.CHANGED, a[ia++])); 107 111 currentDiff.add(new Item(DiffItemType.CHANGED, b[ib++])); 108 } else if (inserted > 0) {112 } else if (inserted > 0) { 109 113 referenceDiff.add(new Item(DiffItemType.EMPTY, null)); 110 114 currentDiff.add(new Item(DiffItemType.INSERTED, b[ib++])); … … 118 122 script = script.link; 119 123 } 120 while (ia < a.length && ib < b.length) {124 while (ia < a.length && ib < b.length) { 121 125 referenceDiff.add(new Item(DiffItemType.SAME, a[ia++])); 122 126 currentDiff.add(new Item(DiffItemType.SAME, b[ib++]));
Note:
See TracChangeset
for help on using the changeset viewer.