diff options
author | albert-github <albert.tests@gmail.com> | 2014-03-02 19:32:42 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2014-03-02 19:32:42 (GMT) |
commit | ac611be473c2d9bf65bcafb53b0577274c4ae706 (patch) | |
tree | 3fa0e5b2798121b937fce6169d6a23e2575d4e1d /src/doxygen.cpp | |
parent | 8eeaae0b06fd320745f22efe176e0f19d6c8e2a6 (diff) | |
download | Doxygen-ac611be473c2d9bf65bcafb53b0577274c4ae706.zip Doxygen-ac611be473c2d9bf65bcafb53b0577274c4ae706.tar.gz Doxygen-ac611be473c2d9bf65bcafb53b0577274c4ae706.tar.bz2 |
In case of sections with the same name they are not reported.
In this patch it is checked if a section label has been used before and if so a warning is given with file name and line number (when possible) where the section label was used the first time.
Note in section.h the item level was not initialized in the past in case of a copy constructor.
Diffstat (limited to 'src/doxygen.cpp')
-rw-r--r-- | src/doxygen.cpp | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 251f2b4..5b8b379 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -8643,15 +8643,30 @@ static void findMainPage(EntryNav *rootNav) Doxygen::mainPage->setShowToc(root->stat); addPageToContext(Doxygen::mainPage,rootNav); - // a page name is a label as well! - SectionInfo *si=new SectionInfo( - indexName, + SectionInfo *si = Doxygen::sectionDict->find(Doxygen::mainPage->name()); + if (si) + { + if (si->lineNr != -1) + { + warn(root->fileName,root->startLine,"multiple use of section label '%s', (first occurrence: %s, line %d)",Doxygen::mainPage->name().data(),si->fileName.data(),si->lineNr); + } + else + { + warn(root->fileName,root->startLine,"multiple use of section label '%s', (first occurrence: %s)",Doxygen::mainPage->name().data(),si->fileName.data()); + } + } + else + { + // a page name is a label as well! but should no be double either + si=new SectionInfo( + indexName, root->startLine, Doxygen::mainPage->name(), Doxygen::mainPage->title(), SectionInfo::Page, 0); // level 0 - Doxygen::sectionDict->append(indexName,si); - Doxygen::mainPage->addSectionsToDefinition(root->anchors); + Doxygen::sectionDict->append(indexName,si); + Doxygen::mainPage->addSectionsToDefinition(root->anchors); + } } else { |