Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergey Prigogin2013-01-21 04:51:40 +0000
committerSergey Prigogin2013-01-21 04:51:40 +0000
commitc1e6dc4ca15200379de8e516335fd75d5cb99d03 (patch)
treeb0571dbcd3e40f8ad9fe99e755e518556640ecbb
parent380f3373da8af4e31ad6e37070848ea5e1c5705c (diff)
downloadorg.eclipse.cdt-c1e6dc4ca15200379de8e516335fd75d5cb99d03.tar.gz
org.eclipse.cdt-c1e6dc4ca15200379de8e516335fd75d5cb99d03.tar.xz
org.eclipse.cdt-c1e6dc4ca15200379de8e516335fd75d5cb99d03.zip
Bug 398611 - Set input for the Outline page conditionally to avoid
unnecessary updates.
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java
index 2d4c743da09..070355e1c15 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/CEditor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2012 IBM Corporation and others.
+ * Copyright (c) 2005, 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
@@ -1637,7 +1637,7 @@ public class CEditor extends TextEditor implements ICEditor, ISelectionChangedLi
fOutlinePage = new CContentOutlinePage(this);
fOutlinePage.addSelectionChangedListener(this);
}
- setOutlinePageInput(fOutlinePage, getEditorInput());
+ setOutlinePageInputIfNotSame(fOutlinePage, getEditorInput());
return fOutlinePage;
}
@@ -2567,6 +2567,16 @@ public class CEditor extends TextEditor implements ICEditor, ISelectionChangedLi
}
}
+ private static void setOutlinePageInputIfNotSame(CContentOutlinePage page, IEditorInput input) {
+ if (page != null) {
+ IWorkingCopyManager manager = CUIPlugin.getDefault().getWorkingCopyManager();
+ IWorkingCopy workingCopy = manager.getWorkingCopy(input);
+ if (workingCopy != page.getRoot()) {
+ page.setInput(workingCopy);
+ }
+ }
+ }
+
/**
* Determines if folding is enabled.
* @return <code>true</code> if folding is enabled, <code>false</code> otherwise.

Back to the top