Skip to content

Commit

Permalink
Bug 753500 - $file when using @name is wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimitri van Heesch committed Sep 14, 2015
1 parent 9a4a4db commit 790887e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 13 deletions.
16 changes: 9 additions & 7 deletions src/commentscan.l
Expand Up @@ -374,7 +374,7 @@ class GuardedSection
void openGroup(Entry *e,const char *file,int line);
void closeGroup(Entry *e,const char *file,int line,bool foundInline=FALSE);
void initGroupInfo(Entry *e);
static void groupAddDocs(Entry *e,const char *fileName);
static void groupAddDocs(Entry *e);

/* -----------------------------------------------------------------
*
Expand Down Expand Up @@ -2996,7 +2996,7 @@ bool parseCommentBlock(/* in */ ParserInterface *parser,
checkFormula();
prot = protection;

groupAddDocs(curEntry,fileName);
groupAddDocs(curEntry);

newEntryNeeded = needNewEntry;

Expand Down Expand Up @@ -3125,17 +3125,18 @@ void openGroup(Entry *e,const char *,int)
}
}

void closeGroup(Entry *e,const char *fileName,int,bool foundInline)
void closeGroup(Entry *e,const char *fileName,int line,bool foundInline)
{
//printf("==> closeGroup(name=%s,sec=%x) g_autoGroupStack=%d\n",
// e->name.data(),e->section,g_autoGroupStack.count());
//printf("==> closeGroup(name=%s,sec=%x,file=%s,line=%d) g_autoGroupStack=%d\n",
// e->name.data(),e->section,fileName,line,g_autoGroupStack.count());
if (g_memberGroupId!=DOX_NOGROUP) // end of member group
{
MemberGroupInfo *info=Doxygen::memGrpInfoDict.find(g_memberGroupId);
if (info) // known group
{
info->doc = g_memberGroupDocs;
info->docFile = fileName;
info->docLine = line;
}
g_memberGroupId=DOX_NOGROUP;
g_memberGroupRelates.resize(0);
Expand Down Expand Up @@ -3169,7 +3170,7 @@ void initGroupInfo(Entry *e)
}
}

static void groupAddDocs(Entry *e,const char *fileName)
static void groupAddDocs(Entry *e)
{
if (e->section==Entry::MEMBERGRP_SEC)
{
Expand All @@ -3184,7 +3185,8 @@ static void groupAddDocs(Entry *e,const char *fileName)
if (info)
{
info->doc = g_memberGroupDocs;
info->docFile = fileName;
info->docFile = e->docFile;
info->docLine = e->docLine;
info->setRefItems(e->sli);
}
e->doc.resize(0);
Expand Down
3 changes: 2 additions & 1 deletion src/membergroup.cpp
Expand Up @@ -42,7 +42,7 @@ MemberGroup::MemberGroup()
}

MemberGroup::MemberGroup(Definition *parent,
int id,const char *hdr,const char *d,const char *docFile)
int id,const char *hdr,const char *d,const char *docFile,int docLine)
{
//printf("New member group id=%d header=%s desc=%s\n",id,hdr,d);
memberList = new MemberList(MemberListType_memberGroup);
Expand All @@ -56,6 +56,7 @@ MemberGroup::MemberGroup(Definition *parent,
m_numDocMembers = -1;
m_parent = parent;
m_docFile = docFile;
m_docLine = docLine;
m_xrefListItems = 0;
//printf("Member group docs=`%s'\n",doc.data());
}
Expand Down
9 changes: 7 additions & 2 deletions src/membergroup.h
Expand Up @@ -42,7 +42,7 @@ class MemberGroup
public:
MemberGroup();
MemberGroup(Definition *parent,int id,const char *header,
const char *docs,const char *docFile);
const char *docs,const char *docFile,int docLine);
~MemberGroup();
QCString header() const { return grpHeader; }
int groupId() const { return grpId; }
Expand Down Expand Up @@ -89,6 +89,9 @@ class MemberGroup
Definition *parent() const { return m_parent; }
QCString anchor() const;

QCString docFile() const { return m_docFile; }
int docLine() const { return m_docLine; }

void marshal(StorageIntf *s);
void unmarshal(StorageIntf *s);

Expand All @@ -105,6 +108,7 @@ class MemberGroup
int m_numDocMembers;
Definition *m_parent;
QCString m_docFile;
int m_docLine;
QList<ListItemInfo> *m_xrefListItems;
};

Expand Down Expand Up @@ -137,12 +141,13 @@ class MemberGroupSDict : public SIntDict<MemberGroup>
/** Data collected for a member group */
struct MemberGroupInfo
{
MemberGroupInfo() : m_sli(0) {}
MemberGroupInfo() : m_sli(0), docLine(-1) {}
~MemberGroupInfo() { delete m_sli; m_sli=0; }
void setRefItems(const QList<ListItemInfo> *sli);
QCString header;
QCString doc;
QCString docFile;
int docLine;
QCString compoundName;
QList<ListItemInfo> *m_sli;
};
Expand Down
2 changes: 1 addition & 1 deletion src/memberlist.cpp
Expand Up @@ -627,7 +627,7 @@ void MemberList::writeDeclarations(OutputList &ol,
{
//printf("Member group has docs!\n");
ol.startMemberGroupDocs();
ol.generateDoc("[generated]",-1,ctx,0,mg->documentation()+"\n",FALSE,FALSE);
ol.generateDoc(mg->docFile(),mg->docLine(),ctx,0,mg->documentation()+"\n",FALSE,FALSE);
ol.endMemberGroupDocs();
}
ol.startMemberGroup();
Expand Down
6 changes: 4 additions & 2 deletions src/util.cpp
Expand Up @@ -5901,7 +5901,8 @@ void addMembersToMemberGroup(MemberList *ml,
groupId,
info->header,
info->doc,
info->docFile
info->docFile,
info->docLine
);
(*ppMemberGroupSDict)->append(groupId,mg);
}
Expand Down Expand Up @@ -5933,7 +5934,8 @@ void addMembersToMemberGroup(MemberList *ml,
groupId,
info->header,
info->doc,
info->docFile
info->docFile,
info->docLine
);
(*ppMemberGroupSDict)->append(groupId,mg);
}
Expand Down

0 comments on commit 790887e

Please sign in to comment.