Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-patch] Error in CView

Hi Alex,

thanks for your patch, I've now applied it to the CDT source
tree.

Cheers,

Sebastien


> -----Original Message-----
> From: Alex Chapiro [mailto:achapiro@xxxxxxx]
> Sent: Monday, August 26, 2002 5:24 PM
> To: cdt-patch@xxxxxxxxxxx
> Subject: [cdt-patch] Error in CView
> 
> 
> This patch fixing a problem in CView.java (bug causes 
> nullpointerexception
> when user switches context).
> 
> Index: CView.java
> ===================================================================
> RCS file:
> /home/tools/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui
> /cview/CView.j
> ava,v
> retrieving revision 1.2
> diff -u -r1.2 CView.java
> --- CView.java 21 Aug 2002 01:06:51 -0000 1.2
> +++ CView.java 26 Aug 2002 21:04:15 -0000
> @@ -998,11 +998,13 @@
>     IEditorReference[] editorReferences = page.getEditorReferences();
>     for (int i = 0; i < editorReferences.length; ++i) {
>      IEditorPart editor = editorReferences[i].getEditor(false);
> -    IEditorInput input = editor.getEditorInput();
> -    if (input instanceof IFileEditorInput
> -    && file.equals(((IFileEditorInput)input).getFile())) {
> -     page.bringToTop(editor);
> -     return;
> +    if(null != editor) {
> +     IEditorInput input = editor.getEditorInput();
> +     if (input instanceof IFileEditorInput
> +     && file.equals(((IFileEditorInput)input).getFile())) {
> +      page.bringToTop(editor);
> +      return;
> +     }
>      }
>     }
>    } else if (obj instanceof ICElement) {
> @@ -1014,15 +1016,17 @@
>     IEditorReference editorReferences[] = page.getEditorReferences();
>     for (int i = 0; i < editorReferences.length; ++i) {
>      IEditorPart editor = editorReferences[i].getEditor(false);
> -    IEditorInput input = editor.getEditorInput();
> -    if (input instanceof IFileEditorInput
> -    && res.equals(((IFileEditorInput)input).getFile())) {
> -     page.bringToTop(editor);
> -     if (editor instanceof CEditor) {
> -      CEditor e = (CEditor)editor;
> -      e.selectionChanged (new SelectionChangedEvent 
> (e.getOutlinePage (),
> selection));
> +    if(null != editor) {
> +     IEditorInput input = editor.getEditorInput();
> +     if (input instanceof IFileEditorInput
> +     && res.equals(((IFileEditorInput)input).getFile())) {
> +      page.bringToTop(editor);
> +      if (editor instanceof CEditor) {
> +       CEditor e = (CEditor)editor;
> +       e.selectionChanged (new SelectionChangedEvent 
> (e.getOutlinePage (),
> selection));
> +      }
> +      return;
>       }
> -     return;
>      }
>     }
> 
> ====================================================
> 
> Alex Chapiro
> 
> _______________________________________________
> cdt-patch mailing list
> cdt-patch@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/cdt-patch
> 


Back to the top