mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-16 04:35:45 +02:00
Merge in fix submitted by Alex Chapiro for NPE in CView
This commit is contained in:
parent
43f276c433
commit
b6d69ba0e1
1 changed files with 14 additions and 12 deletions
|
@ -998,10 +998,11 @@ public class CView extends ViewPart implements IMenuListener, ISetSelectionTarge
|
||||||
IEditorReference[] editorReferences = page.getEditorReferences();
|
IEditorReference[] editorReferences = page.getEditorReferences();
|
||||||
for (int i = 0; i < editorReferences.length; ++i) {
|
for (int i = 0; i < editorReferences.length; ++i) {
|
||||||
IEditorPart editor = editorReferences[i].getEditor(false);
|
IEditorPart editor = editorReferences[i].getEditor(false);
|
||||||
IEditorInput input = editor.getEditorInput();
|
if(null != editor) {
|
||||||
if (input instanceof IFileEditorInput
|
IEditorInput input = editor.getEditorInput();
|
||||||
&& file.equals(((IFileEditorInput)input).getFile())) {
|
if (input instanceof IFileEditorInput && file.equals(((IFileEditorInput)input).getFile())) {
|
||||||
page.bringToTop(editor);
|
page.bringToTop(editor);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1014,15 +1015,16 @@ public class CView extends ViewPart implements IMenuListener, ISetSelectionTarge
|
||||||
IEditorReference editorReferences[] = page.getEditorReferences();
|
IEditorReference editorReferences[] = page.getEditorReferences();
|
||||||
for (int i = 0; i < editorReferences.length; ++i) {
|
for (int i = 0; i < editorReferences.length; ++i) {
|
||||||
IEditorPart editor = editorReferences[i].getEditor(false);
|
IEditorPart editor = editorReferences[i].getEditor(false);
|
||||||
IEditorInput input = editor.getEditorInput();
|
if(null != editor) {
|
||||||
if (input instanceof IFileEditorInput
|
IEditorInput input = editor.getEditorInput();
|
||||||
&& res.equals(((IFileEditorInput)input).getFile())) {
|
if (input instanceof IFileEditorInput && res.equals(((IFileEditorInput)input).getFile())) {
|
||||||
page.bringToTop(editor);
|
page.bringToTop(editor);
|
||||||
if (editor instanceof CEditor) {
|
if (editor instanceof CEditor) {
|
||||||
CEditor e = (CEditor)editor;
|
CEditor e = (CEditor)editor;
|
||||||
e.selectionChanged (new SelectionChangedEvent (e.getOutlinePage (), selection));
|
e.selectionChanged (new SelectionChangedEvent (e.getOutlinePage (),selection));
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue