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

Follow-up fix for 216533

This commit is contained in:
Anton Leherbauer 2008-03-12 12:02:58 +00:00
parent 7446d41232
commit 7fe434b6d8

View file

@ -200,10 +200,10 @@ public class DefaultCFoldingStructureProvider implements ICFoldingStructureProvi
} }
} }
} }
if (statement instanceof IASTForStatement || if (statement instanceof IASTForStatement
statement instanceof IASTWhileStatement || || statement instanceof IASTWhileStatement
statement instanceof IASTDoStatement || || statement instanceof IASTDoStatement
statement instanceof IASTSwitchStatement) { || statement instanceof IASTSwitchStatement) {
fl = statement.getFileLocation(); fl = statement.getFileLocation();
mr.setLength(fl.getNodeLength()); mr.setLength(fl.getNodeLength());
mr.setOffset(fl.getNodeOffset()); mr.setOffset(fl.getNodeOffset());
@ -228,13 +228,16 @@ public class DefaultCFoldingStructureProvider implements ICFoldingStructureProvi
final IASTFunctionDeclarator declarator = ((IASTFunctionDefinition)declaration).getDeclarator(); final IASTFunctionDeclarator declarator = ((IASTFunctionDefinition)declaration).getDeclarator();
if (declarator != null) { if (declarator != null) {
fFunction= new String(declarator.getName().toCharArray()); fFunction= new String(declarator.getName().toCharArray());
fLevel= 0;
} }
} }
return PROCESS_CONTINUE; return PROCESS_CONTINUE;
} }
public int leave(IASTDeclaration declaration) { public int leave(IASTDeclaration declaration) {
fFunction= ""; //$NON-NLS-1$ if (declaration instanceof IASTFunctionDefinition) {
fFunction= ""; //$NON-NLS-1$
}
return PROCESS_CONTINUE; return PROCESS_CONTINUE;
} }