diff options
author | Martin Smith <martin.smith@nokia.com> | 2010-11-19 12:22:11 (GMT) |
---|---|---|
committer | Martin Smith <martin.smith@nokia.com> | 2010-11-19 12:22:11 (GMT) |
commit | c5d942a039b924b0179a9845cce2e4660905f2f8 (patch) | |
tree | a605814657f781e4bdd109ecb147a644ad6810ba | |
parent | 8256a4dfe14b214f517d35178e70f2613131ae99 (diff) | |
download | Qt-c5d942a039b924b0179a9845cce2e4660905f2f8.zip Qt-c5d942a039b924b0179a9845cce2e4660905f2f8.tar.gz Qt-c5d942a039b924b0179a9845cce2e4660905f2f8.tar.bz2 |
qdoc: Replaced all "#location" with "file.xml#location"
-rw-r--r-- | tools/qdoc3/ditaxmlgenerator.cpp | 39 |
1 files changed, 29 insertions, 10 deletions
diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index aace05a..d4285a8 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -976,8 +976,8 @@ int DitaXmlGenerator::generateAtom(const Atom *atom, s = sections.constBegin(); while (s != sections.constEnd()) { if (!(*s).members.isEmpty()) { - writeXrefListItem(QString("#" + Doc::canonicalTitle((*s).name)), - (*s).name); + QString li = outFileName() + "#" + Doc::canonicalTitle((*s).name); + writeXrefListItem(li, (*s).name); } ++s; } @@ -2762,7 +2762,8 @@ void DitaXmlGenerator::generateCompactList(const Node* relative, if (usedParagraphNames.contains(char('a' + i))) { xmlWriter().writeStartElement("xref"); QString guid = lookupGuid(outFileName(),QString(ch)); - xmlWriter().writeAttribute("href",QString("#%1").arg(guid)); + QString attr = outFileName() + QString("#%1").arg(guid); + xmlWriter().writeAttribute("href", attr); xmlWriter().writeCharacters(QString(ch.toUpper())); xmlWriter().writeEndElement(); // </xref> } @@ -2849,16 +2850,17 @@ void DitaXmlGenerator::generateFunctionIndex(const Node* relative, CodeMarker* marker) { xmlWriter().writeStartElement("p"); - xmlWriter().writeAttribute("outputclass","function-index"); - xmlWriter().writeStartElement("b"); + xmlWriter().writeAttribute("outputclass","alphabet"); for (int i = 0; i < 26; i++) { QChar ch('a' + i); xmlWriter().writeStartElement("xref"); - xmlWriter().writeAttribute("href",QString("#%1").arg(ch)); + QString guid = lookupGuid(outFileName(),QString(ch)); + QString attr = outFileName() + QString("#%1").arg(guid); + xmlWriter().writeAttribute("href", attr); xmlWriter().writeCharacters(QString(ch.toUpper())); xmlWriter().writeEndElement(); // </xref> + } - xmlWriter().writeEndElement(); // </b> xmlWriter().writeEndElement(); // </p> char nextLetter = 'a'; @@ -3700,7 +3702,8 @@ void DitaXmlGenerator::generateFullName(const Node* apparentNode, if (actualNode == 0) actualNode = apparentNode; xmlWriter().writeStartElement("xref"); - xmlWriter().writeAttribute("href",linkForNode(actualNode, relative)); + QString href = linkForNode(actualNode, relative); + xmlWriter().writeAttribute("href",href); xmlWriter().writeCharacters(protectEnc(fullName(apparentNode, relative, marker))); xmlWriter().writeEndElement(); // </xref> } @@ -4042,10 +4045,26 @@ QString DitaXmlGenerator::getLink(const Atom* atom, link = linkForNode(*node, relative); if (*node && (*node)->subType() == Node::Image) link = "images/used-in-examples/" + link; - if (targetAtom) - link += "#" + refForAtom(targetAtom, *node); + if (targetAtom) { + if (link.isEmpty()) + link = outFileName(); + QString guid = lookupGuid(link,refForAtom(targetAtom,*node)); + link += "#" + guid; + } +#if 0 + else if (link.isEmpty() && *node) { + link = outFileName() + "#" + (*node)->guid(); + } +#endif + else if (!link.isEmpty() && *node && link.endsWith(".xml")) { + link += "#" + (*node)->guid(); + } } } + if (!link.isEmpty() && link[0] == '#') { + link.prepend(outFileName()); + qDebug() << "LOCAL LINK:" << link; + } return link; } |