Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java19
2 files changed, 12 insertions, 9 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 5922600ca..45504d95f 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
@@ -564,7 +564,7 @@ public abstract class CompareEditorInput extends PlatformObject implements IEdit
* input is disposed at the end making it possible to refer
* during widgets disposal.
*/
- Composite composite = fComposite;
+ Composite composite = (Composite)e.widget;
Control control = composite;
while (composite.getChildren().length > 0) {
control = composite.getChildren()[composite.getChildren().length - 1];
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 49da7cd5a..32c935471 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
@@ -904,14 +904,17 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
provider.removeElementStateListener(this);
}
// If we have a listener registered with the widget, remove it
- if (fSourceViewer != null && !fSourceViewer.getSourceViewer().getTextWidget().isDisposed()) {
- if (fNeedsValidation) {
- fSourceViewer.getSourceViewer().getTextWidget().removeVerifyListener(this);
- fNeedsValidation = false;
- }
- IDocument oldDoc= internalGetDocument(fSourceViewer);
- if (oldDoc != null) {
- oldDoc.removeDocumentListener(this);
+ if (fSourceViewer != null) {
+ StyledText textWidget = fSourceViewer.getSourceViewer().getTextWidget();
+ if (textWidget != null && !textWidget.isDisposed()) {
+ if (fNeedsValidation) {
+ fSourceViewer.getSourceViewer().getTextWidget().removeVerifyListener(this);
+ fNeedsValidation = false;
+ }
+ IDocument oldDoc= internalGetDocument(fSourceViewer);
+ if (oldDoc != null) {
+ oldDoc.removeDocumentListener(this);
+ }
}
}
clearCachedDocument();

Back to the top