Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiraj Modi2020-12-10 07:27:36 +0000
committerNiraj Modi2020-12-10 07:27:36 +0000
commit531212b9a4311fe670339cd05a0ea64f1c88eefa (patch)
tree63c6770ba20d81d369c539c20ea3f9325d403b7d
parentd58237c2b3459fc00116d13129dcd4a81f68ee7b (diff)
downloadeclipse.platform.team-R4_15_maintenance.tar.gz
eclipse.platform.team-R4_15_maintenance.tar.xz
eclipse.platform.team-R4_15_maintenance.zip
Bug 552352 - Using SWAP in Compare editor loses changes and dirty statusR4_15_maintenance
- Back-port fix to 4.15+ branch Change-Id: Iab835c01242ede0a481d17cafd5f603746695317 Signed-off-by: Niraj Modi <niraj.modi@in.ibm.com>
-rw-r--r--bundles/org.eclipse.compare/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java13
-rw-r--r--bundles/org.eclipse.compare/pom.xml2
3 files changed, 14 insertions, 3 deletions
diff --git a/bundles/org.eclipse.compare/META-INF/MANIFEST.MF b/bundles/org.eclipse.compare/META-INF/MANIFEST.MF
index 7a97985b2..b30ee1fc1 100644
--- a/bundles/org.eclipse.compare/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.compare/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.compare; singleton:=true
-Bundle-Version: 3.7.900.qualifier
+Bundle-Version: 3.7.901.qualifier
Bundle-Activator: org.eclipse.compare.internal.CompareUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
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 cab519f96..daa89d98d 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.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -914,6 +914,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) {
diff --git a/bundles/org.eclipse.compare/pom.xml b/bundles/org.eclipse.compare/pom.xml
index d947626b9..723b63562 100644
--- a/bundles/org.eclipse.compare/pom.xml
+++ b/bundles/org.eclipse.compare/pom.xml
@@ -19,6 +19,6 @@
</parent>
<groupId>org.eclipse.compare</groupId>
<artifactId>org.eclipse.compare</artifactId>
- <version>3.7.900-SNAPSHOT</version>
+ <version>3.7.901-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>

Back to the top