diff options
-rw-r--r-- | .travis.yml | 27 | ||||
-rw-r--r-- | src/classdef.cpp | 8 | ||||
-rw-r--r-- | src/classdef.h | 1 | ||||
-rw-r--r-- | src/context.cpp | 2 | ||||
-rw-r--r-- | src/docparser.cpp | 5 | ||||
-rw-r--r-- | src/docparser.h | 3 | ||||
-rw-r--r-- | src/doctokenizer.h | 5 | ||||
-rw-r--r-- | src/doctokenizer.l | 14 | ||||
-rw-r--r-- | src/filedef.cpp | 8 | ||||
-rw-r--r-- | src/groupdef.cpp | 6 | ||||
-rw-r--r-- | src/memberdef.cpp | 32 | ||||
-rw-r--r-- | src/memberdef.h | 6 | ||||
-rw-r--r-- | src/membergroup.cpp | 37 | ||||
-rw-r--r-- | src/membergroup.h | 17 | ||||
-rw-r--r-- | src/memberlist.cpp | 4 | ||||
-rw-r--r-- | src/memberlist.h | 2 | ||||
-rw-r--r-- | src/namespacedef.cpp | 177 | ||||
-rw-r--r-- | src/pagedef.cpp | 2 | ||||
-rw-r--r-- | src/util.cpp | 2 |
19 files changed, 181 insertions, 177 deletions
diff --git a/.travis.yml b/.travis.yml index 48dcff4..0f6a704 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,30 +40,31 @@ jobs: compiler: gcc - <<: *linux-ppc64le compiler: clang - - os: osx - compiler: clang - addons: - homebrew: - packages: - - ghostscript - - bison - - flex - casks: - - mactex-no-gui +# - os: osx +# compiler: clang +# addons: +# homebrew: +# packages: +# - ghostscript +# - bison +# - flex +# casks: +# - mactex-no-gui before_script: - | if [ "${TRAVIS_OS_NAME}" == "linux" ] && [ ! "${OS_NAME}" == "linux-ppc64le" ]; then printf "[requires] - libxml2/2.9.8@bincrafters/stable + libxml2/2.9.9@bincrafters/stable libiconv/1.15@bincrafters/stable" >> conanfile.txt; fi; if [ "${TRAVIS_OS_NAME}" == "osx" ]; then printf "[requires] - libxml2/2.9.8@bincrafters/stable + bzip2/1.0.8@bincrafters/stable + libxml2/2.9.9@bincrafters/stable libiconv/1.15@bincrafters/stable qt/5.12.0@bincrafters/stable - bison/3.0.5@bincrafters/stable + bison/3.3.2@bincrafters/stable [options] qt:shared=True" >> conanfile.txt; fi; diff --git a/src/classdef.cpp b/src/classdef.cpp index 856ab05..b38518c 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -1276,14 +1276,14 @@ void ClassDefImpl::distributeMemberGroupDocumentation() void ClassDefImpl::findSectionsInDocumentation() { - docFindSections(documentation(),this,0,docFile()); + docFindSections(documentation(),this,docFile()); if (m_impl->memberGroupSDict) { MemberGroupSDict::Iterator mgli(*m_impl->memberGroupSDict); MemberGroup *mg; for (;(mg=mgli.current());++mgli) { - mg->findSectionsInDocumentation(); + mg->findSectionsInDocumentation(this); } } QListIterator<MemberList> mli(m_impl->memberLists); @@ -1292,7 +1292,7 @@ void ClassDefImpl::findSectionsInDocumentation() { if ((ml->listType()&MemberListType_detailedLists)==0) { - ml->findSectionsInDocumentation(); + ml->findSectionsInDocumentation(this); } } } @@ -4813,7 +4813,7 @@ void ClassDefImpl::addMemberToList(MemberListType lt,MemberDef *md,bool isBrief) ml->append(md); // for members in the declaration lists we set the section, needed for member grouping - if ((ml->listType()&MemberListType_detailedLists)==0) md->setSectionList(this,ml); + if ((ml->listType()&MemberListType_detailedLists)==0) md->setSectionList(ml); } void ClassDefImpl::sortMemberLists() diff --git a/src/classdef.h b/src/classdef.h index a442ace..e64f0eb 100644 --- a/src/classdef.h +++ b/src/classdef.h @@ -72,7 +72,6 @@ class ClassDef : virtual public Definition virtual ~ClassDef() {} - virtual ClassDef *resolveAlias() = 0; //----------------------------------------------------------------------------------- // --- getters diff --git a/src/context.cpp b/src/context.cpp index 49c9afa..1933d43 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -9302,7 +9302,7 @@ class InheritedMemberInfoListContext::Private : public GenericNodeListContext MemberDef *md; for (li.toFirst();(md=li.current());++li) { - if (lt==md->getSectionList(mg->parent())->listType() && + if (lt==md->getSectionList()->listType() && !md->isReimplementedBy(inheritedFrom) && md->isBriefSectionVisible()) { diff --git a/src/docparser.cpp b/src/docparser.cpp index 9dd1c71..2ee3d7d 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -7797,10 +7797,9 @@ DocText *validatingParseText(const char *input) } void docFindSections(const char *input, - Definition *d, - MemberGroup *mg, + const Definition *d, const char *fileName) { - doctokenizerYYFindSections(input,d,mg,fileName); + doctokenizerYYFindSections(input,d,fileName); } diff --git a/src/docparser.h b/src/docparser.h index e608d8f..84868f7 100644 --- a/src/docparser.h +++ b/src/docparser.h @@ -77,8 +77,7 @@ DocText *validatingParseText(const char *input); /*! Searches for section and anchor commands in the input */ void docFindSections(const char *input, - Definition *d, - MemberGroup *m, + const Definition *d, const char *fileName); //--------------------------------------------------------------------------- diff --git a/src/doctokenizer.h b/src/doctokenizer.h index b59fc09..f89069c 100644 --- a/src/doctokenizer.h +++ b/src/doctokenizer.h @@ -25,7 +25,6 @@ #include "htmlattrib.h" class Definition; -class MemberGroup; enum Tokens { @@ -122,8 +121,8 @@ extern FILE *doctokenizerYYin; const char *tokToString(int token); // operations on the scanner -void doctokenizerYYFindSections(const char *input,Definition *d, - MemberGroup *mg,const char *fileName); +void doctokenizerYYFindSections(const char *input,const Definition *d, + const char *fileName); void doctokenizerYYinit(const char *input,const char *fileName); void doctokenizerYYcleanup(); void doctokenizerYYpushContext(); diff --git a/src/doctokenizer.l b/src/doctokenizer.l index 79c7d0e..6c02bcf 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -57,8 +57,7 @@ static bool g_insidePre; static int g_sharpCount=0; // context for section finding phase -static Definition *g_definition; -static MemberGroup *g_memberGroup; +static const Definition *g_definition; static QCString g_secLabel; static QCString g_secTitle; static SectionInfo::SectionType g_secType; @@ -159,11 +158,7 @@ static void processSection() { //printf("%s: found section/anchor with name '%s'\n",g_fileName.data(),g_secLabel.data()); QCString file; - if (g_memberGroup) - { - file = g_memberGroup->parent()->getOutputFileBase(); - } - else if (g_definition) + if (g_definition) { file = g_definition->getOutputFileBase(); } @@ -1369,8 +1364,8 @@ REFWORD_NOCV {FILEMASK}|{LABELID}|{REFWORD2_NOCV}|{REFWORD3}|{REFWORD4_NOCV} //-------------------------------------------------------------------------- -void doctokenizerYYFindSections(const char *input,Definition *d, - MemberGroup *mg,const char *fileName) +void doctokenizerYYFindSections(const char *input,const Definition *d, + const char *fileName) { if (input==0) return; printlex(yy_flex_debug, TRUE, __FILE__, fileName); @@ -1378,7 +1373,6 @@ void doctokenizerYYFindSections(const char *input,Definition *d, //printf("parsing --->'%s'<---\n",input); g_inputPos = 0; g_definition = d; - g_memberGroup = mg; g_fileName = fileName; BEGIN(St_Sections); doctokenizerYYlineno = 1; diff --git a/src/filedef.cpp b/src/filedef.cpp index 9a82c8a..e4f6c86 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -312,14 +312,14 @@ void FileDefImpl::distributeMemberGroupDocumentation() void FileDefImpl::findSectionsInDocumentation() { - docFindSections(documentation(),this,0,docFile()); + docFindSections(documentation(),this,docFile()); if (m_memberGroupSDict) { MemberGroupSDict::Iterator mgli(*m_memberGroupSDict); MemberGroup *mg; for (;(mg=mgli.current());++mgli) { - mg->findSectionsInDocumentation(); + mg->findSectionsInDocumentation(this); } } @@ -329,7 +329,7 @@ void FileDefImpl::findSectionsInDocumentation() { if (ml->listType()&MemberListType_declarationLists) { - ml->findSectionsInDocumentation(); + ml->findSectionsInDocumentation(this); } } } @@ -2098,7 +2098,7 @@ void FileDefImpl::addMemberToList(MemberListType lt,MemberDef *md) { ml->setInFile(TRUE); } - if (ml->listType()&MemberListType_declarationLists) md->setSectionList(this,ml); + if (ml->listType()&MemberListType_declarationLists) md->setSectionList(ml); } void FileDefImpl::sortMemberLists() diff --git a/src/groupdef.cpp b/src/groupdef.cpp index 9baf0aa..e1fab11 100644 --- a/src/groupdef.cpp +++ b/src/groupdef.cpp @@ -236,12 +236,12 @@ void GroupDefImpl::distributeMemberGroupDocumentation() void GroupDefImpl::findSectionsInDocumentation() { - docFindSections(documentation(),this,0,docFile()); + docFindSections(documentation(),this,docFile()); MemberGroupSDict::Iterator mgli(*memberGroupSDict); MemberGroup *mg; for (;(mg=mgli.current());++mgli) { - mg->findSectionsInDocumentation(); + mg->findSectionsInDocumentation(this); } QListIterator<MemberList> mli(m_memberLists); @@ -250,7 +250,7 @@ void GroupDefImpl::findSectionsInDocumentation() { if (ml->listType()&MemberListType_declarationLists) { - ml->findSectionsInDocumentation(); + ml->findSectionsInDocumentation(this); } } } diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 9d6ac51..469275c 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -59,7 +59,7 @@ class MemberDefImpl : public DefinitionImpl, public MemberDef virtual ~MemberDefImpl(); virtual DefType definitionType() const { return TypeMember; } - virtual MemberDef *resolveAlias() { return this; } + virtual MemberDef *resolveAlias() { return this; } virtual const MemberDef *resolveAlias() const { return this; } virtual MemberDef *deepCopy() const; virtual void moveTo(Definition *); @@ -76,7 +76,7 @@ class MemberDefImpl : public DefinitionImpl, public MemberDef virtual const QCString &initializer() const; virtual int initializerLines() const; virtual uint64 getMemberSpecifiers() const; - virtual const MemberList *getSectionList(const Definition *d) const; + virtual const MemberList *getSectionList() const; virtual QCString displayDefinition() const; virtual const ClassDef *getClassDef() const; virtual ClassDef *getClassDef(); @@ -252,7 +252,7 @@ class MemberDefImpl : public DefinitionImpl, public MemberDef virtual void setBitfields(const char *s); virtual void setMaxInitLines(int lines); virtual void setMemberClass(ClassDef *cd); - virtual void setSectionList(Definition *d,MemberList *sl); + virtual void setSectionList(MemberList *sl); virtual void setGroupDef(GroupDef *gd,Grouping::GroupPri_t pri, const QCString &fileName,int startLine,bool hasDocs, MemberDef *member=0); @@ -380,12 +380,12 @@ class MemberDefAliasImpl : public DefinitionAliasImpl, public MemberDef { public: MemberDefAliasImpl(const Definition *newScope,const MemberDef *md) - : DefinitionAliasImpl(newScope,md) {} + : DefinitionAliasImpl(newScope,md), m_memberGroup(0) {} virtual ~MemberDefAliasImpl() {} virtual DefType definitionType() const { return TypeMember; } - const MemberDef *getMdAlias() const { return dynamic_cast<const MemberDef*>(getAlias()); } - virtual MemberDef *resolveAlias() { return const_cast<MemberDef*>(getMdAlias()); } + const MemberDef *getMdAlias() const { return dynamic_cast<const MemberDef*>(getAlias()); } + virtual MemberDef *resolveAlias() { return const_cast<MemberDef*>(getMdAlias()); } virtual const MemberDef *resolveAlias() const { return getMdAlias(); } virtual MemberDef *deepCopy() const { @@ -419,8 +419,8 @@ class MemberDefAliasImpl : public DefinitionAliasImpl, public MemberDef { return getMdAlias()->initializerLines(); } virtual uint64 getMemberSpecifiers() const { return getMdAlias()->getMemberSpecifiers(); } - virtual const MemberList *getSectionList(const Definition *d) const - { return getMdAlias()->getSectionList(d); } + virtual const MemberList *getSectionList() const + { return getMdAlias()->getSectionList(); } virtual QCString displayDefinition() const { return getMdAlias()->displayDefinition(); } virtual const ClassDef *getClassDef() const @@ -672,7 +672,7 @@ class MemberDefAliasImpl : public DefinitionAliasImpl, public MemberDef virtual int getMemberGroupId() const { return getMdAlias()->getMemberGroupId(); } virtual MemberGroup *getMemberGroup() const - { return getMdAlias()->getMemberGroup(); } + { return m_memberGroup; } virtual bool fromAnonymousScope() const { return getMdAlias()->fromAnonymousScope(); } virtual bool anonymousDeclShown() const @@ -762,7 +762,7 @@ class MemberDefAliasImpl : public DefinitionAliasImpl, public MemberDef virtual void setBitfields(const char *s) {} virtual void setMaxInitLines(int lines) {} virtual void setMemberClass(ClassDef *cd) {} - virtual void setSectionList(Definition *d,MemberList *sl) {} + virtual void setSectionList(MemberList *sl) {} virtual void setGroupDef(GroupDef *gd,Grouping::GroupPri_t pri, const QCString &fileName,int startLine,bool hasDocs, MemberDef *member=0) {} @@ -793,7 +793,7 @@ class MemberDefAliasImpl : public DefinitionAliasImpl, public MemberDef virtual void setType(const char *t) {} virtual void setAccessorType(ClassDef *cd,const char *t) {} virtual void setNamespace(NamespaceDef *nd) {} - virtual void setMemberGroup(MemberGroup *grp) {} + virtual void setMemberGroup(MemberGroup *grp) { m_memberGroup = grp; } virtual void setMemberGroupId(int id) {} virtual void makeImplementationDetail() {} virtual void setFromAnonymousScope(bool b) const {} @@ -849,6 +849,8 @@ class MemberDefAliasImpl : public DefinitionAliasImpl, public MemberDef virtual void warnIfUndocumented() const {} virtual void warnIfUndocumentedParams() const {} virtual void detectUndocumentedParams(bool hasParamCommand,bool hasReturnCommand) const {} + private: + MemberGroup *m_memberGroup; // group's member definition }; @@ -4536,16 +4538,18 @@ void MemberDefImpl::addListReference(Definition *) } } -const MemberList *MemberDefImpl::getSectionList(const Definition *d) const +const MemberList *MemberDefImpl::getSectionList() const { + const Definition *d= resolveAlias()->getOuterScope(); char key[20]; sprintf(key,"%p",d); return (d!=0 && m_impl->classSectionSDict) ? m_impl->classSectionSDict->find(key) : 0; } -void MemberDefImpl::setSectionList(Definition *d, MemberList *sl) +void MemberDefImpl::setSectionList(MemberList *sl) { //printf("MemberDefImpl::setSectionList(%p,%p) name=%s\n",d,sl,name().data()); + const Definition *d= resolveAlias()->getOuterScope(); char key[20]; sprintf(key,"%p",d); if (m_impl->classSectionSDict==0) @@ -4919,7 +4923,7 @@ ClassDef *MemberDefImpl::accessorClass() const void MemberDefImpl::findSectionsInDocumentation() { - docFindSections(documentation(),this,0,docFile()); + docFindSections(documentation(),this,docFile()); } void MemberDefImpl::enableCallGraph(bool e) diff --git a/src/memberdef.h b/src/memberdef.h index c81af80..b200833 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -50,7 +50,7 @@ class MemberDef : virtual public Definition virtual MemberDef *resolveAlias() = 0; virtual const MemberDef *resolveAlias() const = 0; - + //----------------------------------------------------------------------------------- // ---- getters ----- //----------------------------------------------------------------------------------- @@ -70,7 +70,7 @@ class MemberDef : virtual public Definition virtual const QCString &initializer() const = 0; virtual int initializerLines() const = 0; virtual uint64 getMemberSpecifiers() const = 0; - virtual const MemberList *getSectionList(const Definition *d) const = 0; + virtual const MemberList *getSectionList() const = 0; virtual QCString displayDefinition() const = 0; // scope query members @@ -294,7 +294,7 @@ class MemberDef : virtual public Definition virtual void setBitfields(const char *s) = 0; virtual void setMaxInitLines(int lines) = 0; virtual void setMemberClass(ClassDef *cd) = 0; - virtual void setSectionList(Definition *d,MemberList *sl) = 0; + virtual void setSectionList(MemberList *sl) = 0; virtual void setGroupDef(GroupDef *gd,Grouping::GroupPri_t pri, const QCString &fileName,int startLine,bool hasDocs, MemberDef *member=0) = 0; diff --git a/src/membergroup.cpp b/src/membergroup.cpp index a5852e4..c127302 100644 --- a/src/membergroup.cpp +++ b/src/membergroup.cpp @@ -40,8 +40,7 @@ MemberGroup::MemberGroup() { } -MemberGroup::MemberGroup(const Definition *parent, - int id,const char *hdr,const char *d,const char *docFile,int docLine) +MemberGroup::MemberGroup(int id,const char *hdr,const char *d,const char *docFile,int docLine) { static bool sortBriefDocs = Config_getBool(SORT_BRIEF_DOCS); @@ -55,7 +54,6 @@ MemberGroup::MemberGroup(const Definition *parent, inDeclSection = 0; m_numDecMembers = -1; m_numDocMembers = -1; - m_parent = parent; m_docFile = docFile; m_docLine = docLine; m_xrefListItems = 0; @@ -69,33 +67,32 @@ MemberGroup::~MemberGroup() void MemberGroup::insertMember(MemberDef *md) { - //printf("MemberGroup::insertMember m_parent=%s memberList=%p count=%d" + //printf("MemberGroup::insertMember memberList=%p count=%d" // " member section list: %p: md=%p:%s\n", - // m_parent ? m_parent->name().data() : "<null>", - // memberList->first() ? memberList->first()->getSectionList(m_parent) : 0, + // memberList->first() ? memberList->first()->getSectionList() : 0, // memberList->count(), - // md->getSectionList(m_parent), + // md->getSectionList(), // md,md->name().data()); MemberDef *firstMd = memberList->getFirst(); - if (inSameSection && firstMd && - firstMd->getSectionList(m_parent)!=md->getSectionList(m_parent)) + if (inSameSection && firstMd && firstMd->getSectionList()!=md->getSectionList()) { inSameSection=FALSE; } else if (inDeclSection==0) { - inDeclSection = const_cast<MemberList*>(md->getSectionList(m_parent)); + inDeclSection = const_cast<MemberList*>(md->getSectionList()); //printf("inDeclSection=%p type=%d\n",inDeclSection,inDeclSection->listType()); } memberList->append(md); // copy the group of the first member in the memberGroup GroupDef *gd; - if (firstMd && (gd=const_cast<GroupDef*>(firstMd->getGroupDef()))) + if (firstMd && !firstMd->isAlias() && (gd=const_cast<GroupDef*>(firstMd->getGroupDef()))) { - md->setGroupDef(gd, firstMd->getGroupPri(), - firstMd->getGroupFileName(), firstMd->getGroupStartLine(), + md->setGroupDef(gd, firstMd->getGroupPri(), + firstMd->getGroupFileName(), + firstMd->getGroupStartLine(), firstMd->getGroupHasDocs()); gd->insertMember(md); } @@ -152,8 +149,8 @@ void MemberGroup::addGroupedInheritedMembers(OutputList &ol,const ClassDef *cd, MemberDef *md; for (li.toFirst();(md=li.current());++li) { - //printf("matching %d == %d\n",lt,md->getSectionList(m_parent)->listType()); - const MemberList *ml = md->getSectionList(m_parent); + //printf("matching %d == %d\n",lt,md->getSectionList()->listType()); + const MemberList *ml = md->getSectionList(); if (ml && lt==ml->listType()) { MemberList ml(lt); @@ -172,8 +169,8 @@ int MemberGroup::countGroupedInheritedMembers(MemberListType lt) MemberDef *md; for (li.toFirst();(md=li.current());++li) { - //printf("matching %d == %d\n",lt,md->getSectionList(m_parent)->listType()); - const MemberList *ml = md->getSectionList(m_parent); + //printf("matching %d == %d\n",lt,md->getSectionList()->listType()); + const MemberList *ml = md->getSectionList(); if (ml && lt==ml->listType()) { count++; @@ -354,10 +351,10 @@ void MemberGroup::addListReferences(Definition *def) } } -void MemberGroup::findSectionsInDocumentation() +void MemberGroup::findSectionsInDocumentation(const Definition *d) { - docFindSections(doc,0,this,m_docFile); - memberList->findSectionsInDocumentation(); + docFindSections(doc,d,m_docFile); + memberList->findSectionsInDocumentation(d); } void MemberGroup::setRefItems(const QList<ListItemInfo> *sli) diff --git a/src/membergroup.h b/src/membergroup.h index c07d025..c332b56 100644 --- a/src/membergroup.h +++ b/src/membergroup.h @@ -41,7 +41,7 @@ class MemberGroup { public: MemberGroup(); - MemberGroup(const Definition *parent,int id,const char *header, + MemberGroup(int id,const char *header, const char *docs,const char *docFile,int docLine); ~MemberGroup(); QCString header() const { return grpHeader; } @@ -71,19 +71,7 @@ class MemberGroup void countDocMembers(); int countGroupedInheritedMembers(MemberListType lt); void distributeMemberGroupDocumentation(); - void findSectionsInDocumentation(); - /* - int varCount() const; - int funcCount() const; - int enumCount() const; - int enumValueCount() const; - int typedefCount() const; - int sequenceCount() const; - int dictionaryCount() const; - int protoCount() const; - int defineCount() const; - int friendCount() const; - */ + void findSectionsInDocumentation(const Definition *d); int numDecMembers() const; int numDecEnumValues() const; int numDocMembers() const; @@ -94,7 +82,6 @@ class MemberGroup void addListReferences(Definition *d); void setRefItems(const QList<ListItemInfo> *sli); MemberList *members() const { return memberList; } - const Definition *parent() const { return m_parent; } QCString anchor() const; QCString docFile() const { return m_docFile; } diff --git a/src/memberlist.cpp b/src/memberlist.cpp index 1869808..278023b 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -961,7 +961,7 @@ void MemberList::addListReferences(Definition *def) } } -void MemberList::findSectionsInDocumentation() +void MemberList::findSectionsInDocumentation(const Definition *d) { MemberListIterator mli(*this); MemberDef *md; @@ -975,7 +975,7 @@ void MemberList::findSectionsInDocumentation() MemberGroup *mg; for (;(mg=mgli.current());++mgli) { - mg->findSectionsInDocumentation(); + mg->findSectionsInDocumentation(d); } } } diff --git a/src/memberlist.h b/src/memberlist.h index 3c227be..0697df4 100644 --- a/src/memberlist.h +++ b/src/memberlist.h @@ -89,7 +89,7 @@ class MemberList : private QList<MemberDef> void setInGroup(bool inGroup) { m_inGroup=inGroup; } void setInFile(bool inFile) { m_inFile=inFile; } void addListReferences(Definition *def); - void findSectionsInDocumentation(); + void findSectionsInDocumentation(const Definition *d); void setNeedsSorting(bool b); MemberGroupList *getMemberGroupList() const { return memberGroupList; } void setAnonymousEnumType(); diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp index 38e5c04..9a98e0d 100644 --- a/src/namespacedef.cpp +++ b/src/namespacedef.cpp @@ -349,12 +349,12 @@ void NamespaceDefImpl::distributeMemberGroupDocumentation() void NamespaceDefImpl::findSectionsInDocumentation() { - docFindSections(documentation(),this,0,docFile()); + docFindSections(documentation(),this,docFile()); MemberGroupSDict::Iterator mgli(*memberGroupSDict); MemberGroup *mg; for (;(mg=mgli.current());++mgli) { - mg->findSectionsInDocumentation(); + mg->findSectionsInDocumentation(this); } QListIterator<MemberList> mli(m_memberLists); MemberList *ml; @@ -362,7 +362,7 @@ void NamespaceDefImpl::findSectionsInDocumentation() { if (ml->listType()&MemberListType_declarationLists) { - ml->findSectionsInDocumentation(); + ml->findSectionsInDocumentation(this); } } } @@ -467,92 +467,119 @@ void NamespaceDefImpl::addMembersToMemberGroup() void NamespaceDefImpl::insertMember(MemberDef *md) { - //printf("%s::insertMember(%s)\n",qPrint(name()),qPrint(md->name())); + //printf("%s::insertMember(%s) isInline=%d hasDocs=%d\n",qPrint(name()),qPrint(md->name()), + // isInline(),hasDocumentation()); if (md->isHidden()) return; - MemberList *allMemberList = getMemberList(MemberListType_allMembersList); - if (allMemberList==0) - { - allMemberList = new MemberList(MemberListType_allMembersList); - m_memberLists.append(allMemberList); - } - allMemberList->append(md); - if (m_allMembersDict==0) - { - m_allMembersDict = new MemberSDict; - } - //printf("%s::m_allMembersDict->append(%s)\n",name().data(),md->localName().data()); - m_allMembersDict->append(md->localName(),md); - //::addNamespaceMemberNameToIndex(md); - //static bool sortBriefDocs=Config_getBool(SORT_BRIEF_DOCS); - switch(md->memberType()) - { - case MemberType_Variable: - addMemberToList(MemberListType_decVarMembers,md); - addMemberToList(MemberListType_docVarMembers,md); - break; - case MemberType_Function: - addMemberToList(MemberListType_decFuncMembers,md); - addMemberToList(MemberListType_docFuncMembers,md); - break; - case MemberType_Typedef: - addMemberToList(MemberListType_decTypedefMembers,md); - addMemberToList(MemberListType_docTypedefMembers,md); - break; - case MemberType_Sequence: - addMemberToList(MemberListType_decSequenceMembers,md); - addMemberToList(MemberListType_docSequenceMembers,md); - break; - case MemberType_Dictionary: - addMemberToList(MemberListType_decDictionaryMembers,md); - addMemberToList(MemberListType_docDictionaryMembers,md); - break; - case MemberType_Enumeration: - addMemberToList(MemberListType_decEnumMembers,md); - addMemberToList(MemberListType_docEnumMembers,md); - break; - case MemberType_EnumValue: - break; - case MemberType_Define: - addMemberToList(MemberListType_decDefineMembers,md); - addMemberToList(MemberListType_docDefineMembers,md); - break; - default: - err("NamespaceDefImpl::insertMembers(): " - "member '%s' with class scope '%s' inserted in namespace scope '%s'!\n", - md->name().data(), - md->getClassDef() ? md->getClassDef()->name().data() : "", - name().data()); - } - // if this is an inline namespace, then insert an alias of this member in the outer scope. - if (isInline()) + + // if this is an inline namespace that is not documented, then insert the + // member in the parent scope instead + if (isInline() && !hasDocumentation()) { Definition *outerScope = getOuterScope(); if (outerScope) { - MemberDef *aliasMd = 0; if (outerScope->definitionType()==Definition::TypeNamespace) { - aliasMd = createMemberDefAlias(outerScope,md); - dynamic_cast<NamespaceDef*>(outerScope)->insertMember(aliasMd); + NamespaceDef *nd = dynamic_cast<NamespaceDef*>(outerScope); + nd->insertMember(md); + md->setNamespace(nd); } else if (outerScope->definitionType()==Definition::TypeFile) { - aliasMd = createMemberDefAlias(outerScope,md); - dynamic_cast<FileDef*>(outerScope)->insertMember(aliasMd); + FileDef *fd = dynamic_cast<FileDef*>(outerScope); + fd->insertMember(md); + md->setFileDef(fd); + md->setOuterScope(fd); } - if (aliasMd) + } + } + else // member is a non-inline namespace or a documented inline namespace + { + MemberList *allMemberList = getMemberList(MemberListType_allMembersList); + if (allMemberList==0) + { + allMemberList = new MemberList(MemberListType_allMembersList); + m_memberLists.append(allMemberList); + } + allMemberList->append(md); + if (m_allMembersDict==0) + { + m_allMembersDict = new MemberSDict; + } + //printf("%s::m_allMembersDict->append(%s)\n",name().data(),md->localName().data()); + m_allMembersDict->append(md->localName(),md); + //::addNamespaceMemberNameToIndex(md); + //static bool sortBriefDocs=Config_getBool(SORT_BRIEF_DOCS); + switch(md->memberType()) + { + case MemberType_Variable: + addMemberToList(MemberListType_decVarMembers,md); + addMemberToList(MemberListType_docVarMembers,md); + break; + case MemberType_Function: + addMemberToList(MemberListType_decFuncMembers,md); + addMemberToList(MemberListType_docFuncMembers,md); + break; + case MemberType_Typedef: + addMemberToList(MemberListType_decTypedefMembers,md); + addMemberToList(MemberListType_docTypedefMembers,md); + break; + case MemberType_Sequence: + addMemberToList(MemberListType_decSequenceMembers,md); + addMemberToList(MemberListType_docSequenceMembers,md); + break; + case MemberType_Dictionary: + addMemberToList(MemberListType_decDictionaryMembers,md); + addMemberToList(MemberListType_docDictionaryMembers,md); + break; + case MemberType_Enumeration: + addMemberToList(MemberListType_decEnumMembers,md); + addMemberToList(MemberListType_docEnumMembers,md); + break; + case MemberType_EnumValue: + break; + case MemberType_Define: + addMemberToList(MemberListType_decDefineMembers,md); + addMemberToList(MemberListType_docDefineMembers,md); + break; + default: + err("NamespaceDefImpl::insertMembers(): " + "member '%s' with class scope '%s' inserted in namespace scope '%s'!\n", + md->name().data(), + md->getClassDef() ? md->getClassDef()->name().data() : "", + name().data()); + } + // if this is an inline namespace, then insert an alias of this member in the outer scope. + if (isInline()) + { + Definition *outerScope = getOuterScope(); + if (outerScope) { - MemberName *mn; - QCString name = md->name(); - if ((mn=Doxygen::functionNameSDict->find(name))) + MemberDef *aliasMd = 0; + if (outerScope->definitionType()==Definition::TypeNamespace) { - mn->append(aliasMd); + aliasMd = createMemberDefAlias(outerScope,md); + dynamic_cast<NamespaceDef*>(outerScope)->insertMember(aliasMd); } - else + else if (outerScope->definitionType()==Definition::TypeFile) { - mn = new MemberName(name); - mn->append(aliasMd); - Doxygen::functionNameSDict->append(name,mn); + aliasMd = createMemberDefAlias(outerScope,md); + dynamic_cast<FileDef*>(outerScope)->insertMember(aliasMd); + } + if (aliasMd) + { + MemberName *mn; + QCString name = md->name(); + if ((mn=Doxygen::functionNameSDict->find(name))) + { + mn->append(aliasMd); + } + else + { + mn = new MemberName(name); + mn->append(aliasMd); + Doxygen::functionNameSDict->append(name,mn); + } } } } @@ -1460,7 +1487,7 @@ void NamespaceDefImpl::addMemberToList(MemberListType lt,MemberDef *md) if (ml->listType()&MemberListType_declarationLists) { - md->setSectionList(this,ml); + md->setSectionList(ml); } } diff --git a/src/pagedef.cpp b/src/pagedef.cpp index 9f11eb0..8b6228f 100644 --- a/src/pagedef.cpp +++ b/src/pagedef.cpp @@ -99,7 +99,7 @@ PageDefImpl::~PageDefImpl() void PageDefImpl::findSectionsInDocumentation() { - docFindSections(documentation(),this,0,docFile()); + docFindSections(documentation(),this,docFile()); } GroupDef *PageDefImpl::getGroupDef() const diff --git a/src/util.cpp b/src/util.cpp index f5e43a4..3e49384 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -6276,7 +6276,6 @@ void addMembersToMemberGroup(MemberList *ml, if (mg==0) { mg = new MemberGroup( - context, groupId, info->header, info->doc, @@ -6309,7 +6308,6 @@ void addMembersToMemberGroup(MemberList *ml, if (mg==0) { mg = new MemberGroup( - context, groupId, info->header, info->doc, |