summaryrefslogtreecommitdiffstats
path: root/src/util.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2014-03-15 15:54:38 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2014-03-15 15:54:38 (GMT)
commit9ead1e6b562dc91ecd0ef9c55e76d803740ded9b (patch)
tree87089896547550ca1e8d9f5826e53319abb8cd9f /src/util.cpp
parent941eea998d6b9608b8fc586069ef90e805d771f5 (diff)
parentdacdb42c998ecb383c2c9dede7cdaece42b1165e (diff)
downloadDoxygen-9ead1e6b562dc91ecd0ef9c55e76d803740ded9b.zip
Doxygen-9ead1e6b562dc91ecd0ef9c55e76d803740ded9b.tar.gz
Doxygen-9ead1e6b562dc91ecd0ef9c55e76d803740ded9b.tar.bz2
Merge branch 'master' of github.com:doxygen/doxygen
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp31
1 files changed, 23 insertions, 8 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 9d294f0..fecf632 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -6280,14 +6280,29 @@ PageDef *addRelatedPage(const char *name,const QCString &ptitle,
{
file=pd->getOutputFileBase();
}
- SectionInfo *si=new SectionInfo(
- file,pd->name(),pd->title(),SectionInfo::Page,0,pd->getReference());
- //printf("si->label=`%s' si->definition=%s si->fileName=`%s'\n",
- // si->label.data(),si->definition?si->definition->name().data():"<none>",
- // si->fileName.data());
- //printf(" SectionInfo: sec=%p sec->fileName=%s\n",si,si->fileName.data());
- //printf("Adding section key=%s si->fileName=%s\n",pageName.data(),si->fileName.data());
- Doxygen::sectionDict->append(pd->name(),si);
+ SectionInfo *si = Doxygen::sectionDict->find(pd->name());
+ if (si)
+ {
+ if (si->lineNr != -1)
+ {
+ warn(file,-1,"multiple use of section label '%s', (first occurrence: %s, line %d)",pd->name().data(),si->fileName.data(),si->lineNr);
+ }
+ else
+ {
+ warn(file,-1,"multiple use of section label '%s', (first occurrence: %s)",pd->name().data(),si->fileName.data());
+ }
+ }
+ else
+ {
+ si=new SectionInfo(
+ file,-1,pd->name(),pd->title(),SectionInfo::Page,0,pd->getReference());
+ //printf("si->label=`%s' si->definition=%s si->fileName=`%s'\n",
+ // si->label.data(),si->definition?si->definition->name().data():"<none>",
+ // si->fileName.data());
+ //printf(" SectionInfo: sec=%p sec->fileName=%s\n",si,si->fileName.data());
+ //printf("Adding section key=%s si->fileName=%s\n",pageName.data(),si->fileName.data());
+ Doxygen::sectionDict->append(pd->name(),si);
+ }
}
}
return pd;