diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2003-02-15 20:00:58 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2003-02-15 20:00:58 (GMT) |
commit | b0cbd5971eb11555a9ea3ab5c23f2b0b97279b4d (patch) | |
tree | d5ea8d453754a1b971fadd965b8949a3a3d0de9a /src/filedef.cpp | |
parent | 8fda55cdfe71d9e23407169499e918478161328d (diff) | |
download | Doxygen-b0cbd5971eb11555a9ea3ab5c23f2b0b97279b4d.zip Doxygen-b0cbd5971eb11555a9ea3ab5c23f2b0b97279b4d.tar.gz Doxygen-b0cbd5971eb11555a9ea3ab5c23f2b0b97279b4d.tar.bz2 |
Release-1.3-rc3-20020215
Diffstat (limited to 'src/filedef.cpp')
-rw-r--r-- | src/filedef.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/filedef.cpp b/src/filedef.cpp index d360813..d3b606b 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -651,26 +651,32 @@ void FileDef::addIncludeDependency(FileDef *fd,const char *incName,bool local) void FileDef::addIncludedUsingDirectives() { - if (!visited) + if (visited) return; + visited=TRUE; + //printf("( FileDef::addIncludedUsingDirectives for file %s\n",name().data()); + + NamespaceList nl; + if (includeList) // file contains #includes { - visited=TRUE; - NamespaceList nl; - if (includeList) // file contains #includes { QListIterator<IncludeInfo> iii(*includeList); IncludeInfo *ii; - for (;(ii=iii.current());++iii) // foreach #include... + for (iii.toFirst();(ii=iii.current());++iii) // foreach #include... { - if (ii->fileDef) // ...that is a known file + if (ii->fileDef && !ii->fileDef->visited) // ...that is a known file { // recurse into this file ii->fileDef->addIncludedUsingDirectives(); } } + } + { + QListIterator<IncludeInfo> iii(*includeList); + IncludeInfo *ii; // iterate through list from last to first for (iii.toLast();(ii=iii.current());--iii) { - if (ii->fileDef) + if (ii->fileDef && ii->fileDef!=this) { NamespaceList *unl = ii->fileDef->usingDirList; if (unl) @@ -681,14 +687,16 @@ void FileDef::addIncludedUsingDirectives() { // append each using directive found in a #include file if (usingDirList==0) usingDirList = new NamespaceList; + //printf("Prepending used namespace %s to the list of file %s\n", + // nd->name().data(),name().data()); usingDirList->prepend(nd); } } } } } - // add elements of nl to usingDirList } + //printf(") end FileDef::addIncludedUsingDirectives for file %s\n",name().data()); } |