diff options
author | albert-github <albert.tests@gmail.com> | 2020-09-24 13:20:13 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2020-09-24 13:20:13 (GMT) |
commit | 17390b669f7a1017fa937410880da38a540dfa35 (patch) | |
tree | d6f3e41e51c2c6552c979bb460569bd88382877d /src/util.cpp | |
parent | 55e15c86717f38c9b510e4287cb0b4f165b8cb10 (diff) | |
download | Doxygen-17390b669f7a1017fa937410880da38a540dfa35.zip Doxygen-17390b669f7a1017fa937410880da38a540dfa35.tar.gz Doxygen-17390b669f7a1017fa937410880da38a540dfa35.tar.bz2 |
Miscounting of lines in respect to page command
All examples together are a bit big so they are all in the attached file together with the warnings before and after this patch.
When looking at the output we see that a number of lines are off by 1 ore more due to the insertion of extra lines in the code or due to the fact that there is a reference to the start of the documentation of the page and not the line of the page command.
- commentscan.l
in case of a rule contaiinge {DOCNL} this can be `=n` or `\ilinebr` in the later case this should not be replaced by `\n` as this results in an increase of the line count later on.
in case of a page like command also register the line of the command as "topline".
- entry.h, entry.cpp
storage space for the "topline" registering the line of the page like commands.
- doxygen.cpp
setting and using the "topline"
- markdown.cpp, markdown.h
don't add a `\n` as this increases the line count but use the `\ilinebr`
to get correct warnings see to it that when having empty lines at the top of the page and a page is added that the empty lines appear after the page command.
- index.cpp
using the "topline" instead of the "docLine" to get the correct warning
- pagedef.cpp, pagedef.h
set and retrieve the "topline" for page like commands.
- util.cpp, util.h
setting and using the "topline"
in `addRelatedPage` use the known file name and line for the warning regarding the section label
- cite.cpp, context.cpp, reflist.cpp
changed to have good function calls.
Diffstat (limited to 'src/util.cpp')
-rw-r--r-- | src/util.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/util.cpp b/src/util.cpp index 6b30584..dc75911 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -6012,7 +6012,7 @@ found: PageDef *addRelatedPage(const char *name,const QCString &ptitle, const QCString &doc, - const char *fileName,int startLine, + const char *fileName,int startLine,int topLine, const RefItemVector &sli, GroupDef *gd, const TagInfo *tagInfo, @@ -6024,8 +6024,8 @@ PageDef *addRelatedPage(const char *name,const QCString &ptitle, //printf("addRelatedPage(name=%s gd=%p)\n",name,gd); 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()); + if (!xref) warn(fileName,topLine,"multiple use of page label '%s', (other occurrence: %s, line: %d)", + name,pd->docFile().data(),pd->topLine()); // append documentation block to the page. pd->setDocumentation(doc,fileName,startLine); //printf("Adding page docs '%s' pi=%p name=%s\n",doc.data(),pd,name); @@ -6041,7 +6041,7 @@ 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,startLine,topLine,baseName,doc,title); pd->setRefItems(sli); pd->setLanguage(lang); @@ -6063,24 +6063,26 @@ PageDef *addRelatedPage(const char *name,const QCString &ptitle, // a page name is a label as well! QCString file; + int line = -1; if (gd) { file=gd->getOutputFileBase(); } else { - file=pd->getOutputFileBase(); + file=pd->docFile(); + line = pd->topLine(); } 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(file,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(file,line,"multiple use of section label '%s', (first occurrence: %s)",pd->name().data(),si->fileName().data()); } } else |