From 8750eae466f066ebb50a565b8efe90f7ce7ee360 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 11 Feb 2010 15:14:53 +0100 Subject: qdoc3: Completed handling of the new \pagekeywords command. Task: QTBUG-7877 --- tools/qdoc3/htmlgenerator.cpp | 11 ++++++++++- tools/qdoc3/node.h | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index ca0cd7e..e341a03 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -4384,10 +4384,13 @@ bool HtmlGenerator::generatePageElement(QXmlStreamWriter& writer, return true; if (node->access() == Node::Private) return false; + if (!node->isInnerNode()) + return false; QString title; QString rawTitle; QString fullTitle; + const InnerNode* inner = static_cast(node); writer.writeStartElement("page"); QXmlStreamAttributes attributes; @@ -4407,7 +4410,6 @@ bool HtmlGenerator::generatePageElement(QXmlStreamWriter& writer, } case Node::Namespace: { - const InnerNode* inner = static_cast(node); rawTitle = marker->plainName(inner); fullTitle = marker->plainFullName(inner); title = rawTitle + " Namespace Reference"; @@ -4420,6 +4422,13 @@ bool HtmlGenerator::generatePageElement(QXmlStreamWriter& writer, writer.writeAttribute("id",t); writer.writeStartElement("pageWords"); writer.writeCharacters(title); + if (!inner->pageKeywords().isEmpty()) { + const QStringList& w = inner->pageKeywords(); + for (int i = 0; i < w.size(); ++i) { + writer.writeCharacters(" "); + writer.writeCharacters(w.at(i).toLocal8Bit().constData()); + } + } writer.writeEndElement(); writer.writeStartElement("pageTitle"); writer.writeCharacters(title); diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h index 6a540d4..021a052 100644 --- a/tools/qdoc3/node.h +++ b/tools/qdoc3/node.h @@ -257,7 +257,7 @@ class InnerNode : public Node QStringList primaryKeys(); QStringList secondaryKeys(); - QStringList pageKeywords() { return pageKeywds; } + const QStringList& pageKeywords() const { return pageKeywds; } virtual void addPageKeywords(const QString& t) { pageKeywds << t; } protected: -- cgit v0.12