diff options
author | Martin Smith <msmith@trolltech.com> | 2009-06-18 12:28:25 (GMT) |
---|---|---|
committer | Martin Smith <msmith@trolltech.com> | 2009-06-18 12:29:42 (GMT) |
commit | cc4935dc0641336813925b3892ffd6695d709d19 (patch) | |
tree | 88ef68eac0392a24acad9b6bc98f1b9c8830fd0e /tools | |
parent | b7280820144b3cf1bbd49a26f5e532bb9b7f388d (diff) | |
download | Qt-cc4935dc0641336813925b3892ffd6695d709d19.zip Qt-cc4935dc0641336813925b3892ffd6695d709d19.tar.gz Qt-cc4935dc0641336813925b3892ffd6695d709d19.tar.bz2 |
qdoc: Fixed crash when a compact list section was empty.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index c14b46d..8ef4f0b 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -1850,8 +1850,10 @@ HtmlGenerator::generateAnnotatedList(const Node *relative, out() << "</table></p>\n"; } -void HtmlGenerator::generateCompactList(const Node *relative, CodeMarker *marker, - const QMap<QString, const Node *> &classMap) +void +HtmlGenerator::generateCompactList(const Node *relative, + CodeMarker *marker, + const QMap<QString,const Node*> &classMap) { const int NumParagraphs = 37; // '0' to '9', 'A' to 'Z', '_' const int NumColumns = 4; // number of columns in the result @@ -1994,28 +1996,29 @@ void HtmlGenerator::generateCompactList(const Node *relative, CodeMarker *marker << " </b>"; } out() << "</td>\n"; - - // bad loop - QMap<QString, const Node *>::Iterator it; - it = paragraph[currentParagraphNo[i]].begin(); - for (j = 0; j < currentOffsetInParagraph[i]; j++) - ++it; - - out() << "<td>"; - // Previously, we used generateFullName() for this, but we - // require some special formatting. - out() << "<a href=\"" - << linkForNode(it.value(), relative) - << "\">"; - QStringList pieces = fullName(it.value(), relative, marker).split("::"); - out() << protect(pieces.last()); - out() << "</a>"; - if (pieces.size() > 1) { - out() << " ("; - generateFullName(it.value()->parent(), relative, marker); - out() << ")"; - } - out() << "</td>\n"; + + if (!paragraphName[currentParagraphNo[i]].isEmpty()) { + QMap<QString, const Node *>::Iterator it; + it = paragraph[currentParagraphNo[i]].begin(); + for (j = 0; j < currentOffsetInParagraph[i]; j++) + ++it; + + out() << "<td>"; + // Previously, we used generateFullName() for this, but we + // require some special formatting. + out() << "<a href=\"" + << linkForNode(it.value(), relative) + << "\">"; + QStringList pieces = fullName(it.value(), relative, marker).split("::"); + out() << protect(pieces.last()); + out() << "</a>"; + if (pieces.size() > 1) { + out() << " ("; + generateFullName(it.value()->parent(), relative, marker); + out() << ")"; + } + out() << "</td>\n"; + } currentOffset[i]++; currentOffsetInParagraph[i]++; |