1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 356275 - Project Explorer: Link with Editor does not work for C/C++ projects

This commit is contained in:
Anton Leherbauer 2011-09-19 11:00:43 +02:00
parent 0fd03f628b
commit e0bca93e1a

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2005, 2010 IBM Corporation and others. * Copyright (c) 2005, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -335,11 +335,14 @@ public class BaseCElementContentProvider implements ITreeContentProvider {
} }
Object parent = null; Object parent = null;
if (element instanceof ICElement) { if (element instanceof ICElement) {
if (element instanceof ICContainer && !CCorePlugin.showSourceRootsAtTopOfProject()) { if (element instanceof ISourceRoot && !CCorePlugin.showSourceRootsAtTopOfProject()) {
parent = ((ICContainer) element).getResource().getParent(); parent = ((ICElement) element).getResource().getParent();
if (parent instanceof IProject) {
return ((ICElement) element).getCProject();
}
} }
else else
parent = ((ICElement)element).getParent(); parent = ((ICElement)element).getParent();
// translate working copy parent to original TU, // translate working copy parent to original TU,
// because working copies are never returned by getChildren // because working copies are never returned by getChildren
// this is necessary for proper show-in-target support // this is necessary for proper show-in-target support