summaryrefslogtreecommitdiffstats
path: root/src/util.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2020-10-04 18:47:51 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2020-10-04 18:47:51 (GMT)
commit43cf803fa0c105f584da9479d0a20f704900f418 (patch)
tree1d41e0e0f53e4332c0ed8a58ba98ed0e4ae280f0 /src/util.cpp
parent8afc2218f92d509803c71cffa3f6ea0f41704738 (diff)
parentc46e7ae8a25ec64b91ab39bf5246aa69e729d25b (diff)
downloadDoxygen-43cf803fa0c105f584da9479d0a20f704900f418.zip
Doxygen-43cf803fa0c105f584da9479d0a20f704900f418.tar.gz
Doxygen-43cf803fa0c105f584da9479d0a20f704900f418.tar.bz2
Merge branch 'albert-github-feature/bug_md_pg_cnt'
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 869e20b..78de1a8 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -6004,7 +6004,9 @@ found:
PageDef *addRelatedPage(const char *name,const QCString &ptitle,
const QCString &doc,
- const char *fileName,int startLine,
+ const char *fileName,
+ int docLine,
+ int startLine,
const RefItemVector &sli,
GroupDef *gd,
const TagInfo *tagInfo,
@@ -6017,9 +6019,9 @@ PageDef *addRelatedPage(const char *name,const QCString &ptitle,
if ((pd=Doxygen::pageSDict->find(name)) && !tagInfo)
{
if (!xref) warn(fileName,startLine,"multiple use of page label '%s', (other occurrence: %s, line: %d)",
- name,pd->docFile().data(),pd->docLine());
+ name,pd->docFile().data(),pd->getStartBodyLine());
// append documentation block to the page.
- pd->setDocumentation(doc,fileName,startLine);
+ pd->setDocumentation(doc,fileName,docLine);
//printf("Adding page docs '%s' pi=%p name=%s\n",doc.data(),pd,name);
// append (x)refitems to the page.
pd->setRefItems(sli);
@@ -6033,7 +6035,8 @@ PageDef *addRelatedPage(const char *name,const QCString &ptitle,
baseName=baseName.left(baseName.length()-Doxygen::htmlFileExtension.length());
QCString title=ptitle.stripWhiteSpace();
- pd=createPageDef(fileName,startLine,baseName,doc,title);
+ pd=createPageDef(fileName,docLine,baseName,doc,title);
+ pd->setBodySegment(startLine,startLine,-1);
pd->setRefItems(sli);
pd->setLanguage(lang);
@@ -6055,24 +6058,29 @@ PageDef *addRelatedPage(const char *name,const QCString &ptitle,
// a page name is a label as well!
QCString file;
+ QCString orgFile;
+ int line = -1;
if (gd)
{
file=gd->getOutputFileBase();
+ orgFile=gd->getOutputFileBase();
}
else
{
file=pd->getOutputFileBase();
+ orgFile=pd->docFile();
+ line = pd->getStartBodyLine();
}
const SectionInfo *si = SectionManager::instance().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());
+ warn(orgFile,line,"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());
+ warn(orgFile,line,"multiple use of section label '%s', (first occurrence: %s)",pd->name().data(),si->fileName().data());
}
}
else