diff options
author | Martin Smith <msmith@trolltech.com> | 2010-04-20 10:33:25 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2010-04-21 03:05:39 (GMT) |
commit | 0732ebb54714557c1851c74f8d4d3f516db2bf1d (patch) | |
tree | 8253c444f1479c3a95399372431af67da012d897 /tools | |
parent | fa0954a0efb808190f093157b1b2f4aeb10f394f (diff) | |
download | Qt-0732ebb54714557c1851c74f8d4d3f516db2bf1d.zip Qt-0732ebb54714557c1851c74f8d4d3f516db2bf1d.tar.gz Qt-0732ebb54714557c1851c74f8d4d3f516db2bf1d.tar.bz2 |
qdoc: Avoided putting bad chars in links
(cherry picked from commit 0a6faf00f06c8a0e2e0f4714bb14645172ee8922)
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qdoc3/doc.cpp | 11 | ||||
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 6 |
2 files changed, 10 insertions, 7 deletions
diff --git a/tools/qdoc3/doc.cpp b/tools/qdoc3/doc.cpp index ad4cdde..5716626 100644 --- a/tools/qdoc3/doc.cpp +++ b/tools/qdoc3/doc.cpp @@ -3036,7 +3036,7 @@ QString Doc::canonicalTitle(const QString &title) QString result; result.reserve(title.size()); - bool slurping = false; + bool dashAppended = false; bool begun = false; int lastAlnum = 0; for (int i = 0; i != title.size(); ++i) { @@ -3047,18 +3047,21 @@ QString Doc::canonicalTitle(const QString &title) if (alnum) { result += QLatin1Char(c); begun = true; - slurping = false; + dashAppended = false; lastAlnum = result.size(); } - else if (!slurping) { + else if (!dashAppended) { if (begun) result += QLatin1Char('-'); - slurping = true; + dashAppended = true; } +#if 0 + // This was screwing things up. else { result += title[i]; lastAlnum = result.size(); } +#endif } result.truncate(lastAlnum); return result; diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 68c27db..40203f8 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -414,9 +414,7 @@ void HtmlGenerator::generateTree(const Tree *tree, CodeMarker *marker) generateIndex(fileBase, projectUrl, projectDescription); generatePageIndex(outputDir() + "/" + fileBase + ".pageindex", marker); - //qDebug() << "start helpProjectWriter->generate(myTree)"; helpProjectWriter->generate(myTree); - //qDebug() << "end helpProjectWriter->generate(myTree)"; } void HtmlGenerator::startText(const Node * /* relative */, @@ -1986,10 +1984,12 @@ void HtmlGenerator::generateTableOfContents(const Node *node, } int numAtoms; Text headingText = Text::sectionHeading(atom); + QString s = headingText.toString(); out() << "<li>"; out() << "<a href=\"" << "#" - << Doc::canonicalTitle(headingText.toString()) + //<< registerRef(s) + << Doc::canonicalTitle(s) << "\">"; generateAtomList(headingText.firstAtom(), node, marker, true, numAtoms); out() << "</a></li>\n"; |