Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiraj Modi2020-12-10 08:04:34 +0000
committerNiraj Modi2020-12-10 08:23:08 +0000
commit9de1abf789c2b02156ad3e3900edcad6d8f09b0c (patch)
tree9db6ea4b34cda4f5b309ef25a4aad848ae32974c
parent4e86d3bf51d96f36a8f9f68f5179800676d7408e (diff)
downloadeclipse.platform.team-R4_8_maintenance.tar.gz
eclipse.platform.team-R4_8_maintenance.tar.xz
eclipse.platform.team-R4_8_maintenance.zip
Bug 552352 - Using SWAP in Compare editor loses changes and dirty statusR4_8_maintenance
- Back-port fix to 4.8+ branch Change-Id: I944345001c4567545de08ba13da1097f9bb2227c Signed-off-by: Niraj Modi <niraj.modi@in.ibm.com>
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java
index 87af3c009..568f2f32f 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -902,6 +902,17 @@ public abstract class ContentMergeViewer extends ContentViewer
fSwitchLeftAndRight = new Action() {
@Override
public void run() {
+ /*
+ * Bug 552352: When comparing .txt files with corresponding .txt file editors
+ * closed and user modifies the content of one of the .txt file in the compare
+ * view and the compare state becomes 'dirty' and if followed by a 'Swap'
+ * action, modifications get lost. This data loss is considered a severe
+ * problem, so to avoid this modified data loss in this scenario, show a
+ * confirmation dialog to 'save' the file before swapping and let user decide
+ * and take a call on this. Note: Issue not seen with .java & .properties files.
+ */
+ doSave(null, getInput());
+
IPreferenceStore preferences = getCompareConfiguration().getPreferenceStore();
preferences.setValue(ComparePreferencePage.SWAPPED, !getCompareConfiguration().isMirrored());
if (preferences instanceof IPersistentPreferenceStore) {

Back to the top