From cfae4dbc59a2f2c0bee8857ecdaa59ad0590f32b Mon Sep 17 00:00:00 2001 From: Anton Leherbauer Date: Wed, 2 Apr 2008 07:25:33 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20for=20225099:=20Breakpoint=20toggling=20f?= =?UTF-8?q?or=20files=20outside=20projects=20is=20broken=20in=20CDT=20CVS?= =?UTF-8?q?=20HEAD=20Patch=20by=20=C3=98yvind=20Harboe=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../internal/ui/actions/ToggleBreakpointAdapter.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleBreakpointAdapter.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleBreakpointAdapter.java index 0006e412c61..9bd191f7b28 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleBreakpointAdapter.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ToggleBreakpointAdapter.java @@ -9,6 +9,7 @@ * QNX Software Systems - Initial API and implementation * Freescale Semiconductor - Address watchpoints, https://bugs.eclipse.org/bugs/show_bug.cgi?id=118299 * Warren Paul (Nokia) - Bug 217485, Bug 218342 + * Oyvind Harboe (oyvind.harboe@zylin.com) - Bug 225099 *******************************************************************************/ package org.eclipse.cdt.debug.internal.ui.actions; @@ -290,11 +291,15 @@ public class ToggleBreakpointAdapter implements IToggleBreakpointsTarget { IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); if ( part instanceof IEditorPart ) { IEditorInput editorInput = ((IEditorPart)part).getEditorInput(); + IResource resource = null; if ( editorInput instanceof IFileEditorInput ) { - return ((IFileEditorInput)editorInput).getFile(); + resource = ((IFileEditorInput)editorInput).getFile(); } else if (editorInput instanceof ExternalEditorInput) { - return ((ExternalEditorInput)editorInput).getMarkerResource(); + resource = ((ExternalEditorInput)editorInput).getMarkerResource(); } + if (resource != null) + return resource; + /* This file is not in a project, let default case handle it */ ILocationProvider provider = (ILocationProvider)editorInput.getAdapter( ILocationProvider.class ); if ( provider != null ) { IPath location = provider.getPath( editorInput );