qdoc: Do not write index.dita multiple times in ditamap.
authorCasper van Donderen <casper.vandonderen@nokia.com>
Sun, 25 Mar 2012 18:22:52 +0000 (20:22 +0200)
committerQt by Nokia <qt-info@nokia.com>
Wed, 28 Mar 2012 03:07:08 +0000 (05:07 +0200)
Change-Id: I69719237d0ab567ce2a606c96b38f6baa2a601b5
Reviewed-by: Martin Smith <martin.smith@nokia.com>
src/tools/qdoc/ditaxmlgenerator.cpp

index a25fc0d..1f0a383 100644 (file)
@@ -5838,6 +5838,9 @@ void DitaXmlGenerator::writeDitaMap(const Tree *tree)
 {
     QString doctype;
 
+/*
+    Remove #if 0 to get a flat ditamap.
+*/
 #if 0
     beginSubPage(tree->root(),"qt.ditamap");
     doctype = "<!DOCTYPE map PUBLIC \"-//OASIS//DTD DITA Map//EN\" \"map.dtd\">";
@@ -5969,6 +5972,12 @@ void DitaXmlGenerator::writeTopicrefs(NodeMultiMap* nmm, const QString& navtitle
     xmlWriter().writeAttribute("navtitle",navtitle);
     NodeMultiMap::iterator i = nmm->begin();
     while (i != nmm->end()) {
+        // Hardcode not writing index.dita multiple times in the tree.
+        // index.dita should only appear at the top of the ditamap.
+        if (fileName(i.value()) == "index.dita") {
+            i++;
+            continue;
+        }
         writeStartTag(DT_topicref);
         xmlWriter().writeAttribute("navtitle",i.key());
         xmlWriter().writeAttribute("href",fileName(i.value()));