diff options
author | Martin Smith <msmith@trolltech.com> | 2010-05-04 13:33:02 (GMT) |
---|---|---|
committer | Martin Smith <msmith@trolltech.com> | 2010-05-04 13:33:02 (GMT) |
commit | 409ced7dc098438e185b9a6db6b3f53b1472839d (patch) | |
tree | 912a5a7c3cc9dd0b99005a9c7b06bc9eb7c81ec3 /tools/qdoc3/htmlgenerator.cpp | |
parent | ae0dfbf4718fc24a8f68a8c7b307b2a808d0f4dc (diff) | |
download | Qt-409ced7dc098438e185b9a6db6b3f53b1472839d.zip Qt-409ced7dc098438e185b9a6db6b3f53b1472839d.tar.gz Qt-409ced7dc098438e185b9a6db6b3f53b1472839d.tar.bz2 |
qdoc: Fixed the alphabet index in the compact list.
Now it leaves out any letter that doesn't appear in
the list. i.e. If there are no classes that begin
with QJ... J does not appear in the alphabet index.
Diffstat (limited to 'tools/qdoc3/htmlgenerator.cpp')
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 569d1cd..d32ae99 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -2399,6 +2399,7 @@ void HtmlGenerator::generateCompactList(const Node *relative, */ NodeMap paragraph[NumParagraphs+1]; QString paragraphName[NumParagraphs+1]; + QSet<char> usedParagraphNames; NodeMap::ConstIterator c = classMap.begin(); while (c != classMap.end()) { @@ -2422,6 +2423,7 @@ void HtmlGenerator::generateCompactList(const Node *relative, } paragraphName[paragraphNo] = key[0].toUpper(); + usedParagraphNames.insert(key[0].toLower().cell()); paragraph[paragraphNo].insert(key, c.value()); ++c; } @@ -2469,12 +2471,12 @@ void HtmlGenerator::generateCompactList(const Node *relative, out() << "<p class=\"centerAlign functionIndex\"><b>"; for (int i = 0; i < 26; i++) { QChar ch('a' + i); - out() << QString("<a href=\"#%1\">%2</a> ").arg(ch).arg(ch.toUpper()); + if (usedParagraphNames.contains(char('a' + i))) + out() << QString("<a href=\"#%1\">%2</a> ").arg(ch).arg(ch.toUpper()); } out() << "</b></p>\n"; } - QSet<char> used; out() << "<table class=\"generic\">\n"; for (k = 0; k < numRows; k++) { out() << "<tr>\n"; @@ -2502,7 +2504,6 @@ void HtmlGenerator::generateCompactList(const Node *relative, if (includeAlphabet) { QChar c = paragraphName[currentParagraphNo[i]][0].toLower(); out() << QString("<a name=\"%1\"></a>").arg(c); - used.insert(c.cell()); } out() << "<b>" << paragraphName[currentParagraphNo[i]] @@ -2545,12 +2546,6 @@ void HtmlGenerator::generateCompactList(const Node *relative, out() << "</tr>\n"; } out() << "</table>\n"; - char C = 'a'; - while (C <= 'z') { - if (!used.contains(C)) - out() << QString("<a name=\"%1\"></a>").arg(C); - ++C; - } } void HtmlGenerator::generateFunctionIndex(const Node *relative, |