@@ -148,7 +148,8 @@ enum class CommandSpacing
148
148
{
149
149
Invisible, // command sets some property but does not appear in the output.
150
150
Inline, // command appears inline in the output which can be a brief description.
151
- Block // command starts a new paragraphs / ends a brief description.
151
+ Block, // command starts a new paragraphs / ends a brief description.
152
+ XRef // command is a cross reference (todo, bug, test, xrefitem).
152
153
};
153
154
154
155
struct DocCmdMap
@@ -170,7 +171,7 @@ static const std::map< std::string, DocCmdMap > docCmdMap =
170
171
{ " author" , { 0 , CommandSpacing::Block }},
171
172
{ " authors" , { 0 , CommandSpacing::Block }},
172
173
{ " brief" , { &handleBrief, CommandSpacing::Invisible }},
173
- { " bug" , { &handleBug, CommandSpacing::Block }},
174
+ { " bug" , { &handleBug, CommandSpacing::XRef }},
174
175
{ " callergraph" , { &handleCallergraph, CommandSpacing::Invisible }},
175
176
{ " callgraph" , { &handleCallgraph, CommandSpacing::Invisible }},
176
177
{ " category" , { &handleCategory, CommandSpacing::Invisible }},
@@ -283,10 +284,10 @@ static const std::map< std::string, DocCmdMap > docCmdMap =
283
284
{ " subsection" , { &handleSection, CommandSpacing::Block }},
284
285
{ " subsubsection" , { &handleSection, CommandSpacing::Block }},
285
286
{ " tableofcontents" , { &handleToc, CommandSpacing::Invisible }},
286
- { " test" , { &handleTest, CommandSpacing::Block }},
287
+ { " test" , { &handleTest, CommandSpacing::XRef }},
287
288
{ " throw" , { 0 , CommandSpacing::Block }},
288
289
{ " throws" , { 0 , CommandSpacing::Block }},
289
- { " todo" , { &handleTodo, CommandSpacing::Block }},
290
+ { " todo" , { &handleTodo, CommandSpacing::XRef }},
290
291
{ " tparam" , { 0 , CommandSpacing::Block }},
291
292
{ " typedef" , { &handleFn, CommandSpacing::Invisible }},
292
293
{ " union" , { &handleUnion, CommandSpacing::Invisible }},
@@ -299,7 +300,7 @@ static const std::map< std::string, DocCmdMap > docCmdMap =
299
300
{ " weakgroup" , { &handleWeakGroup, CommandSpacing::Invisible }},
300
301
{ " xmlinclude" , { 0 , CommandSpacing::Inline }},
301
302
{ " xmlonly" , { &handleFormatBlock, CommandSpacing::Invisible }},
302
- { " xrefitem" , { &handleXRefItem, CommandSpacing::Block }}
303
+ { " xrefitem" , { &handleXRefItem, CommandSpacing::XRef }}
303
304
};
304
305
305
306
#define YY_NO_INPUT 1
@@ -2831,28 +2832,29 @@ static void addXRefItem(yyscan_t yyscanner,
2831
2832
2832
2833
RefList *refList = RefListManager::instance ().add (listName,listTitle,itemTitle);
2833
2834
RefItem *item = 0 ;
2834
- for (RefItem *i : yyextra->current ->sli )
2835
+ for (auto it = yyextra->current ->sli . rbegin (); it != yyextra-> current -> sli . rend (); ++it )
2835
2836
{
2837
+ RefItem *i = *it;
2836
2838
if (i && qstrcmp (i->list ()->listName (),listName)==0 )
2837
2839
{
2838
- // printf("found %s lii->type=%s\n",listName,lii->type );
2840
+ // printf("found %s lii->type=%s\n",listName,i->list()->listName().data() );
2839
2841
item = i;
2840
2842
break ;
2841
2843
}
2842
2844
}
2843
2845
if (item && append) // already found item of same type just before this one
2844
2846
{
2845
- // printf("listName=%s item id = %d existing\n",listName,lii->itemId );
2847
+ // printf("listName=%s item id = %d existing\n",listName,item->id() );
2846
2848
item->setText (item->text () + " <p>" + yyextra->outputXRef );
2847
2849
// printf("%s: text +=%s\n",listName,item->text.data());
2848
2850
}
2849
2851
else // new item
2850
2852
{
2851
- // printf("listName=%s item id = %d new yyextra->current=%p\n",listName,itemId,yyextra->current);
2852
2853
2853
2854
// if we have already an item from the same list type (e.g. a second @todo)
2854
2855
// in the same Entry (i.e. lii!=0) then we reuse its link anchor.
2855
2856
item = refList->add ();
2857
+ // printf("listName=%s item id = %d new yyextra->current=%p\n",listName,item->id(),yyextra->current);
2856
2858
QCString anchorLabel;
2857
2859
anchorLabel.sprintf (" _%s%06d" ,listName,item->id ());
2858
2860
item->setText (yyextra->outputXRef );
0 commit comments