diff options
author | Topi Reinio <topi.reinio@qt.io> | 2018-09-04 12:32:34 +0200 |
---|---|---|
committer | Martin Smith <martin.smith@qt.io> | 2018-09-06 08:46:32 +0000 |
commit | e0b6973d41f402f512cf86e490e4638dd5913937 (patch) | |
tree | 012cbbec986887900aa8ae1aaf26427e860242e1 /src/qdoc | |
parent | 53094d904447abf2c720dbec1bf8d6e63d53af14 (diff) |
qdoc: Fix generation of namespace documentation
Commit a36f925d refactored the Section-related code, resulting
in different data structures used for storing sections for
C++ classes and namespaces. However, the HTML generator
still assumed that the same structure could be used for both,
resulting in invalid/no output for namespace documentation.
This commit fixes it by selecting the correct vector based
on whether we're processing a class or a namespace node.
Task-number: QTBUG-70321
Change-Id: Ia80dec9193e22c453350588aba10f4c033f6ba79
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Martin Smith <martin.smith@qt.io>
Diffstat (limited to 'src/qdoc')
-rw-r--r-- | src/qdoc/htmlgenerator.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/qdoc/htmlgenerator.cpp b/src/qdoc/htmlgenerator.cpp index 223120298..d08690f2e 100644 --- a/src/qdoc/htmlgenerator.cpp +++ b/src/qdoc/htmlgenerator.cpp @@ -1350,7 +1350,8 @@ void HtmlGenerator::generateCppReferencePage(Node* node, CodeMarker* marker) generateHeader(title, aggregate, marker); Sections sections(aggregate); - generateTableOfContents(aggregate, marker, §ions.stdCppClassSummarySections()); + SectionVector *sectionVector = ns ? §ions.stdSummarySections() : §ions.stdCppClassSummarySections(); + generateTableOfContents(aggregate, marker, sectionVector); generateKeywordAnchors(aggregate); generateTitle(title, subtitleText, SmallSubTitle, aggregate, marker); if (ns && !ns->hasDoc() && ns->docNode()) { @@ -1390,8 +1391,8 @@ void HtmlGenerator::generateCppReferencePage(Node* node, CodeMarker* marker) bool needOtherSection = false; - SectionVector::ConstIterator s = sections.stdCppClassSummarySections().constBegin(); - while (s != sections.stdCppClassSummarySections().constEnd()) { + SectionVector::ConstIterator s = sectionVector->constBegin(); + while (s != sectionVector->constEnd()) { if (s->members().isEmpty() && s->reimplementedMembers().isEmpty()) { if (!s->inheritedMembers().isEmpty()) needOtherSection = true; @@ -1426,8 +1427,8 @@ void HtmlGenerator::generateCppReferencePage(Node* node, CodeMarker* marker) out() << "<h3>Additional Inherited Members</h3>\n" "<ul>\n"; - s = sections.stdCppClassSummarySections().constBegin(); - while (s != sections.stdCppClassSummarySections().constEnd()) { + s = sectionVector->constBegin(); + while (s != sectionVector->constEnd()) { if (s->members().isEmpty() && !s->inheritedMembers().isEmpty()) generateSectionInheritedList(*s, aggregate); ++s; @@ -1450,8 +1451,9 @@ void HtmlGenerator::generateCppReferencePage(Node* node, CodeMarker* marker) generateExtractionMark(aggregate, EndMark); } - s = sections.stdCppClassDetailsSections().constBegin(); - while (s != sections.stdCppClassDetailsSections().constEnd()) { + sectionVector = ns ? §ions.stdDetailsSections() : §ions.stdCppClassDetailsSections(); + s = sectionVector->constBegin(); + while (s != sectionVector->constEnd()) { //out() << "<hr />\n"; if (!s->divClass().isEmpty()) out() << "<div class=\"" << s->divClass() << "\">\n"; // QTBUG-9504 |