diff options
author | Martin Smith <martin.smith@nokia.com> | 2010-08-19 13:00:22 (GMT) |
---|---|---|
committer | Martin Smith <martin.smith@nokia.com> | 2010-08-19 13:00:22 (GMT) |
commit | 1d991c8df38e0c5e75f99ad26ebcbe35ff674751 (patch) | |
tree | b463f08428d5a21fe2a52324ac57911bfd9eaa33 | |
parent | d0a25e466ea0234d03caff4ab0742484c37ae39f (diff) | |
download | Qt-1d991c8df38e0c5e75f99ad26ebcbe35ff674751.zip Qt-1d991c8df38e0c5e75f99ad26ebcbe35ff674751.tar.gz Qt-1d991c8df38e0c5e75f99ad26ebcbe35ff674751.tar.bz2 |
qdoc: Added more elements to qt.pageindex
Task-nr: QTBUG-11113
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index f3390de..3e79a9f 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -4537,6 +4537,35 @@ bool HtmlGenerator::generatePageElement(QXmlStreamWriter& writer, } writer.writeEndElement(); writer.writeEndElement(); + + if (node->type() == Node::Fake && node->doc().hasTableOfContents()) { + QList<Atom*> toc = node->doc().tableOfContents(); + if (!toc.isEmpty()) { + for (int i = 0; i < toc.size(); ++i) { + Text headingText = Text::sectionHeading(toc.at(i)); + QString s = headingText.toString(); + writer.writeStartElement("page"); + t.setNum(id++); + QString internalUrl = url + "#" + Doc::canonicalTitle(s); + writer.writeAttribute("id",t); + writer.writeStartElement("pageWords"); + writer.writeCharacters(pageWords.join(" ")); + writer.writeCharacters(" "); + writer.writeCharacters(s); + writer.writeEndElement(); + writer.writeStartElement("pageTitle"); + writer.writeCharacters(s); + writer.writeEndElement(); + writer.writeStartElement("pageUrl"); + writer.writeCharacters(internalUrl); + writer.writeEndElement(); + writer.writeStartElement("pageType"); + writer.writeCharacters("Article"); + writer.writeEndElement(); + writer.writeEndElement(); + } + } + } return true; } |