diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-12-02 19:52:08 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2020-12-02 19:52:08 (GMT) |
commit | 38e56645b7527ce70a90f4fcf1bd046fafc50248 (patch) | |
tree | 779d79f3c84f7e3a2cfcdf2392a3bb76f61fd4c5 | |
parent | 4372054e0b7af9c0cd1c1390859d8fef3581d8bb (diff) | |
download | Doxygen-38e56645b7527ce70a90f4fcf1bd046fafc50248.zip Doxygen-38e56645b7527ce70a90f4fcf1bd046fafc50248.tar.gz Doxygen-38e56645b7527ce70a90f4fcf1bd046fafc50248.tar.bz2 |
Join sequences of the same type of xref items together in a single paragraph (restores 1.8.16 behavior)
-rw-r--r-- | src/commentscan.l | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/commentscan.l b/src/commentscan.l index 10efef1..e636aa6 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -148,7 +148,8 @@ enum class CommandSpacing { Invisible, // command sets some property but does not appear in the output. Inline, // command appears inline in the output which can be a brief description. - Block // command starts a new paragraphs / ends a brief description. + Block, // command starts a new paragraphs / ends a brief description. + XRef // command is a cross reference (todo, bug, test, xrefitem). }; struct DocCmdMap @@ -170,7 +171,7 @@ static const std::map< std::string, DocCmdMap > docCmdMap = { "author", { 0, CommandSpacing::Block }}, { "authors", { 0, CommandSpacing::Block }}, { "brief", { &handleBrief, CommandSpacing::Invisible }}, - { "bug", { &handleBug, CommandSpacing::Block }}, + { "bug", { &handleBug, CommandSpacing::XRef }}, { "callergraph", { &handleCallergraph, CommandSpacing::Invisible }}, { "callgraph", { &handleCallgraph, CommandSpacing::Invisible }}, { "category", { &handleCategory, CommandSpacing::Invisible }}, @@ -283,10 +284,10 @@ static const std::map< std::string, DocCmdMap > docCmdMap = { "subsection", { &handleSection, CommandSpacing::Block }}, { "subsubsection", { &handleSection, CommandSpacing::Block }}, { "tableofcontents", { &handleToc, CommandSpacing::Invisible }}, - { "test", { &handleTest, CommandSpacing::Block }}, + { "test", { &handleTest, CommandSpacing::XRef }}, { "throw", { 0, CommandSpacing::Block }}, { "throws", { 0, CommandSpacing::Block }}, - { "todo", { &handleTodo, CommandSpacing::Block }}, + { "todo", { &handleTodo, CommandSpacing::XRef }}, { "tparam", { 0, CommandSpacing::Block }}, { "typedef", { &handleFn, CommandSpacing::Invisible }}, { "union", { &handleUnion, CommandSpacing::Invisible }}, @@ -299,7 +300,7 @@ static const std::map< std::string, DocCmdMap > docCmdMap = { "weakgroup", { &handleWeakGroup, CommandSpacing::Invisible }}, { "xmlinclude", { 0, CommandSpacing::Inline }}, { "xmlonly", { &handleFormatBlock, CommandSpacing::Invisible }}, - { "xrefitem", { &handleXRefItem, CommandSpacing::Block }} + { "xrefitem", { &handleXRefItem, CommandSpacing::XRef }} }; #define YY_NO_INPUT 1 @@ -2831,28 +2832,29 @@ static void addXRefItem(yyscan_t yyscanner, RefList *refList = RefListManager::instance().add(listName,listTitle,itemTitle); RefItem *item = 0; - for (RefItem *i : yyextra->current->sli) + for (auto it = yyextra->current->sli.rbegin(); it != yyextra->current->sli.rend(); ++it) { + RefItem *i = *it; if (i && qstrcmp(i->list()->listName(),listName)==0) { - //printf("found %s lii->type=%s\n",listName,lii->type); + //printf("found %s lii->type=%s\n",listName,i->list()->listName().data()); item = i; break; } } if (item && append) // already found item of same type just before this one { - //printf("listName=%s item id = %d existing\n",listName,lii->itemId); + //printf("listName=%s item id = %d existing\n",listName,item->id()); item->setText(item->text() + " <p>" + yyextra->outputXRef); //printf("%s: text +=%s\n",listName,item->text.data()); } else // new item { - //printf("listName=%s item id = %d new yyextra->current=%p\n",listName,itemId,yyextra->current); // if we have already an item from the same list type (e.g. a second @todo) // in the same Entry (i.e. lii!=0) then we reuse its link anchor. item = refList->add(); + //printf("listName=%s item id = %d new yyextra->current=%p\n",listName,item->id(),yyextra->current); QCString anchorLabel; anchorLabel.sprintf("_%s%06d",listName,item->id()); item->setText(yyextra->outputXRef); |