Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2017-02-19 06:51:15 -0500
committerAndrey Loskutov2017-03-02 09:50:02 -0500
commit4c395500d1ea10ec726ce49d3c66d0d43295aeb9 (patch)
tree11dfe6786c07497807614d66f4f4f144f5fb0864
parentae7c6d260707e92921ca4bc923ddef30bca0d860 (diff)
downloadeclipse.platform.team-4c395500d1ea10ec726ce49d3c66d0d43295aeb9.tar.gz
eclipse.platform.team-4c395500d1ea10ec726ce49d3c66d0d43295aeb9.tar.xz
eclipse.platform.team-4c395500d1ea10ec726ce49d3c66d0d43295aeb9.zip
Bug 512395 - "Copy all from right to left" has no effect in some cases
Change-Id: I43eaa289cb2e2f2767795ef18f945eeb6b14a6e7 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java27
1 files changed, 7 insertions, 20 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
index a8fb2e16d..5c39790af 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
@@ -4954,28 +4954,15 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
try {
for (Iterator<?> iterator = fMerger.changesIterator(); iterator.hasNext();) {
Diff diff = (Diff) iterator.next();
- switch (diff.getKind()) {
- case RangeDifference.LEFT:
- if (leftToRight) {
- if (!compoundChangeStarted) {
- target.beginCompoundChange();
- compoundChangeStarted= true;
- }
- copy(diff, leftToRight);
- }
- break;
- case RangeDifference.RIGHT:
- if (!leftToRight) {
- if (!compoundChangeStarted) {
- target.beginCompoundChange();
- compoundChangeStarted= true;
- }
- copy(diff, leftToRight);
- }
- break;
- default:
+ int kind = diff.getKind();
+ if (kind != RangeDifference.LEFT && kind != RangeDifference.RIGHT) {
continue;
}
+ if (!compoundChangeStarted) {
+ target.beginCompoundChange();
+ compoundChangeStarted = true;
+ }
+ copy(diff, leftToRight);
}
} finally {
if (compoundChangeStarted) {

Back to the top