diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2016-05-25 09:10:59 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2016-05-25 09:10:59 (GMT) |
commit | e7ac59b018cdf609cc7c6819f38a7de05c699058 (patch) | |
tree | 95bb60290685671e3273f61baaeee409bae96f18 /src | |
parent | ee9a0664c03c306d0aeb127295ced29f8078ae03 (diff) | |
download | Doxygen-e7ac59b018cdf609cc7c6819f38a7de05c699058.zip Doxygen-e7ac59b018cdf609cc7c6819f38a7de05c699058.tar.gz Doxygen-e7ac59b018cdf609cc7c6819f38a7de05c699058.tar.bz2 |
Bug 766809 - Enumerations heading present but none listed
Diffstat (limited to 'src')
-rw-r--r-- | src/memberlist.cpp | 65 | ||||
-rw-r--r-- | src/memberlist.h | 1 |
2 files changed, 29 insertions, 37 deletions
diff --git a/src/memberlist.cpp b/src/memberlist.cpp index 1b81108..ee8762f 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -253,6 +253,32 @@ MemberListIterator::MemberListIterator(const QList<MemberDef> &l) : { } +int MemberList::countEnumValues(MemberDef *md,bool setAnonEnumType) const +{ + int enumVars=0; + MemberListIterator vmli(*this); + MemberDef *vmd; + QCString name(md->name()); + int i=name.findRev("::"); + if (i!=-1) name=name.right(name.length()-i-2); // strip scope (TODO: is this needed?) + if (name[0]=='@') // anonymous enum => append variables + { + for ( ; (vmd=vmli.current()) ; ++vmli) + { + QCString vtype=vmd->typeString(); + if ((vtype.find(name))!=-1) + { + enumVars++; + if (setAnonEnumType) + { + vmd->setAnonymousEnumType(md); + } + } + } + } + return enumVars; +} + bool MemberList::declVisible() const { MemberListIterator mli(*this); @@ -277,26 +303,9 @@ bool MemberList::declVisible() const return TRUE; case MemberType_Enumeration: { - int enumVars=0; - MemberListIterator vmli(*this); - MemberDef *vmd; - QCString name(md->name()); - int i=name.findRev("::"); - if (i!=-1) name=name.right(name.length()-i-2); // strip scope (TODO: is this needed?) - if (name[0]=='@') // anonymous enum => append variables - { - for ( ; (vmd=vmli.current()) ; ++vmli) - { - QCString vtype=vmd->typeString(); - if ((vtype.find(name))!=-1) - { - enumVars++; - } - } - } // if this is an anonymous enum and there are variables of this // enum type (i.e. enumVars>0), then we do not show the enum here. - if (enumVars==0) // show enum here + if (countEnumValues(md,FALSE)==0) // show enum here { return TRUE; } @@ -368,27 +377,9 @@ void MemberList::writePlainDeclarations(OutputList &ol, } case MemberType_Enumeration: { - int enumVars=0; - MemberListIterator vmli(*this); - MemberDef *vmd; - QCString name(md->name()); - int i=name.findRev("::"); - if (i!=-1) name=name.right(name.length()-i-2); // strip scope (TODO: is this needed?) - if (name[0]=='@') // anonymous enum => append variables - { - for ( ; (vmd=vmli.current()) ; ++vmli) - { - QCString vtype=vmd->typeString(); - if ((vtype.find(name))!=-1) - { - enumVars++; - vmd->setAnonymousEnumType(md); - } - } - } // if this is an anonymous enum and there are variables of this // enum type (i.e. enumVars>0), then we do not show the enum here. - if (enumVars==0 && !hideUndocMembers) // show enum here + if (countEnumValues(md,TRUE)==0) // show enum here { //printf("Enum!!\n"); if (first) diff --git a/src/memberlist.h b/src/memberlist.h index c293d22..ddd5686 100644 --- a/src/memberlist.h +++ b/src/memberlist.h @@ -82,6 +82,7 @@ class MemberList : public QList<MemberDef> private: int compareValues(const MemberDef *item1,const MemberDef *item2) const; + int countEnumValues(MemberDef *md,bool setAnonEnumType) const; int m_varCnt; int m_funcCnt; int m_enumCnt; |