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

Code formatter: Fix skipping of non-local declarations

This commit is contained in:
Anton Leherbauer 2006-12-15 10:38:13 +00:00
parent 5b682fb34f
commit 2631135c07

View file

@ -246,6 +246,9 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
IASTDeclaration[] decls= tu.getDeclarations();
for (int i = 0; i < decls.length; i++) {
IASTDeclaration declaration = decls[i];
if (!fTranslationUnitFile.equals(declaration.getContainingFilename())) {
continue;
}
try {
declaration.accept(this);
scribe.printNewLine();
@ -270,9 +273,6 @@ public class CodeFormatterVisitor extends CPPASTVisitor {
* @see org.eclipse.cdt.core.dom.ast.ASTVisitor#visit(org.eclipse.cdt.core.dom.ast.IASTDeclaration)
*/
public int visit(IASTDeclaration node) {
if (!fTranslationUnitFile.equals(node.getContainingFilename())) {
return PROCESS_SKIP;
}
int indentLevel= scribe.indentationLevel;
try {
if (node.getNodeLocations()[0] instanceof IASTMacroExpansion) {