diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2014-08-18 08:21:16 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2014-08-18 08:21:16 (GMT) |
commit | 8b279c9bc28c70405e61219a6c2b3c6dbc7426e6 (patch) | |
tree | 8b5992a20a6f12debdd0b75362032a1d4684013c /src | |
parent | 6385a83aa86bc5ad741d8068a574c5851bed708a (diff) | |
download | Doxygen-8b279c9bc28c70405e61219a6c2b3c6dbc7426e6.zip Doxygen-8b279c9bc28c70405e61219a6c2b3c6dbc7426e6.tar.gz Doxygen-8b279c9bc28c70405e61219a6c2b3c6dbc7426e6.tar.bz2 |
Bug 734727 - GENERATE_TAGFILE no longer includes any @*section links
Changed the previous fix to allow references to sections defined in
a mainpage that is imported via a tag file.
Diffstat (limited to 'src')
-rw-r--r-- | src/doxygen.cpp | 31 | ||||
-rw-r--r-- | src/tagreader.cpp | 23 |
2 files changed, 35 insertions, 19 deletions
diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 168725d..533e6ef 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -8628,15 +8628,16 @@ static void buildPageList(EntryNav *rootNav) RECURSE_ENTRYTREE(buildPageList,rootNav); } +// search for the main page defined in this project static void findMainPage(EntryNav *rootNav) { if (rootNav->section() == Entry::MAINPAGEDOC_SEC) { rootNav->loadEntry(g_storage); - Entry *root = rootNav->entry(); - if (Doxygen::mainPage==0) + if (Doxygen::mainPage==0 && rootNav->tagInfo()==0) { + Entry *root = rootNav->entry(); //printf("Found main page! \n======\n%s\n=======\n",root->doc.data()); QCString title=root->args.stripWhiteSpace(); //QCString indexName=Config_getBool("GENERATE_TREEVIEW")?"main":"index"; @@ -8648,7 +8649,7 @@ static void findMainPage(EntryNav *rootNav) Doxygen::mainPage->setFileName(indexName,TRUE); Doxygen::mainPage->setShowToc(root->stat); addPageToContext(Doxygen::mainPage,rootNav); - + SectionInfo *si = Doxygen::sectionDict->find(Doxygen::mainPage->name()); if (si) { @@ -8674,11 +8675,12 @@ static void findMainPage(EntryNav *rootNav) Doxygen::mainPage->addSectionsToDefinition(root->anchors); } } - else + else if (rootNav->tagInfo()==0) { + Entry *root = rootNav->entry(); warn(root->fileName,root->startLine, - "found more than one \\mainpage comment block! Skipping this " - "block." + "found more than one \\mainpage comment block! Skipping this " + "block." ); } @@ -8687,6 +8689,22 @@ static void findMainPage(EntryNav *rootNav) RECURSE_ENTRYTREE(findMainPage,rootNav); } +// search for the main page imported via tag files and add only the section labels +static void findMainPageTagFiles(EntryNav *rootNav) +{ + if (rootNav->section() == Entry::MAINPAGEDOC_SEC) + { + rootNav->loadEntry(g_storage); + + if (Doxygen::mainPage && rootNav->tagInfo()) + { + Entry *root = rootNav->entry(); + Doxygen::mainPage->addSectionsToDefinition(root->anchors); + } + } + RECURSE_ENTRYTREE(findMainPageTagFiles,rootNav); +} + static void computePageRelations(EntryNav *rootNav) { if ((rootNav->section()==Entry::PAGEDOC_SEC || @@ -11083,6 +11101,7 @@ void parseInput() g_s.begin("Search for main page...\n"); findMainPage(rootNav); + findMainPageTagFiles(rootNav); g_s.end(); g_s.begin("Computing page relations...\n"); diff --git a/src/tagreader.cpp b/src/tagreader.cpp index b4fc9ed..23b8f13 100644 --- a/src/tagreader.cpp +++ b/src/tagreader.cpp @@ -1431,19 +1431,16 @@ void TagFileParser::buildLists(Entry *root) TagPageInfo *tpi; for (pgit.toFirst();(tpi=pgit.current());++pgit) { - if (tpi->filename!="index") // skip mainpage, there can be only one (see bug734727) - { - Entry *pe = new Entry; - pe->section = Entry::PAGEDOC_SEC; - pe->name = tpi->name; - pe->args = tpi->title; - addDocAnchors(pe,tpi->docAnchors); - TagInfo *ti = new TagInfo; - ti->tagName = m_tagName; - ti->fileName = tpi->filename; - pe->tagInfo = ti; - root->addSubEntry(pe); - } + Entry *pe = new Entry; + pe->section = tpi->filename=="index" ? Entry::MAINPAGEDOC_SEC : Entry::PAGEDOC_SEC; + pe->name = tpi->name; + pe->args = tpi->title; + addDocAnchors(pe,tpi->docAnchors); + TagInfo *ti = new TagInfo; + ti->tagName = m_tagName; + ti->fileName = tpi->filename; + pe->tagInfo = ti; + root->addSubEntry(pe); } } |