Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java20
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceSaveableComparison.java35
2 files changed, 33 insertions, 22 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
index 85a8c5fcf..5922600ca 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 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
@@ -1152,15 +1152,21 @@ public abstract class CompareEditorInput extends PlatformObject implements IEdit
private void setDirty(Object source, boolean dirty) {
Assert.isNotNull(source);
boolean oldDirty = isSaveNeeded();
- ContentMergeViewer cmv = (ContentMergeViewer) source;
- if (dirty == cmv.internalIsLeftDirty()) {
- fLeftDirty = cmv.internalIsLeftDirty();
- }
+ if (source instanceof ContentMergeViewer) {
+ ContentMergeViewer cmv = (ContentMergeViewer) source;
+
+ if (dirty == cmv.internalIsLeftDirty()) {
+ fLeftDirty = cmv.internalIsLeftDirty();
+ }
- if (dirty == cmv.internalIsRightDirty()) {
- fRightDirty = cmv.internalIsRightDirty();
+ if (dirty == cmv.internalIsRightDirty()) {
+ fRightDirty = cmv.internalIsRightDirty();
+ }
+ } else {
+ fLeftDirty = dirty;
}
+
boolean newDirty = isSaveNeeded();
if (DEBUG) {
System.out.println("setDirty(" + source + ", " + dirty + "): " + newDirty); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceSaveableComparison.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceSaveableComparison.java
index afa44be74..ea3f947dc 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceSaveableComparison.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/LocalResourceSaveableComparison.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 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
@@ -287,22 +287,27 @@ public abstract class LocalResourceSaveableComparison extends SaveableComparison
if (newValue instanceof Boolean)
changed= ((Boolean)newValue).booleanValue();
- ContentMergeViewer cmv = (ContentMergeViewer) e.getSource();
-
- if (input.getLeft() != null && input.getLeft().equals(fileElement)) {
- if (changed && cmv.internalIsLeftDirty())
- setDirty(changed);
- else if (!changed && !cmv.internalIsLeftDirty()) {
- setDirty(changed);
+ Object source = e.getSource();
+ if (source instanceof ContentMergeViewer) {
+ ContentMergeViewer cmv = (ContentMergeViewer) source;
+ if (input.getLeft() != null
+ && input.getLeft().equals(fileElement)) {
+ if (changed && cmv.internalIsLeftDirty())
+ setDirty(changed);
+ else if (!changed && !cmv.internalIsLeftDirty()) {
+ setDirty(changed);
+ }
}
- }
- if (input.getRight() != null
- && input.getRight().equals(fileElement)) {
- if (changed && cmv.internalIsRightDirty())
- setDirty(changed);
- else if (!changed && !cmv.internalIsRightDirty()) {
- setDirty(changed);
+ if (input.getRight() != null
+ && input.getRight().equals(fileElement)) {
+ if (changed && cmv.internalIsRightDirty())
+ setDirty(changed);
+ else if (!changed && !cmv.internalIsRightDirty()) {
+ setDirty(changed);
+ }
}
+ } else {
+ setDirty(changed);
}
}
}

Back to the top