Commit 69af1c8a authored by Dimitri van Heesch's avatar Dimitri van Heesch

Brief description did not appear in the page index, when a page did not have any details.

parent 496c3bb5
......@@ -2848,7 +2848,8 @@ bool parseCommentBlock(/* in */ ParserInterface *parser,
if (parseMore) position=inputPosition; else position=0;
lineNr = yyLineNr;
//printf("position=%d parseMore=%d\n",position,parseMore);
//printf("position=%d parseMore=%d newEntryNeeded=%d\n",
// position,parseMore,newEntryNeeded);
return parseMore;
}
......
......@@ -67,6 +67,7 @@ class DefinitionImpl
DocInfo *inbodyDocs; // not exported
BriefInfo *brief; // not exported
BodyInfo *body; // not exported
QCString briefSignatures;
QCString docSignatures;
QCString localName; // local (unqualified) name of the definition
......@@ -536,7 +537,7 @@ void Definition::writeDocAnchorsToTagFile()
}
}
bool Definition::_docsAlreadyAdded(const QCString &doc)
bool Definition::_docsAlreadyAdded(const QCString &doc,QCString &sigList)
{
uchar md5_sig[16];
QCString sigStr(33);
......@@ -545,9 +546,11 @@ bool Definition::_docsAlreadyAdded(const QCString &doc)
QCString docStr = doc.simplifyWhiteSpace();
MD5Buffer((const unsigned char *)docStr.data(),docStr.length(),md5_sig);
MD5SigToString(md5_sig,sigStr.data(),33);
if (m_impl->docSignatures.find(sigStr)==-1) // new docs, add signature to prevent re-adding it
//printf("%s:_docsAlreadyAdded doc='%s' sig='%s' docSigs='%s'\n",
// name().data(),doc.data(),sigStr.data(),sigList.data());
if (sigList.find(sigStr)==-1) // new docs, add signature to prevent re-adding it
{
m_impl->docSignatures+=":"+sigStr;
sigList+=":"+sigStr;
return FALSE;
}
else
......@@ -570,7 +573,7 @@ void Definition::_setDocumentation(const char *d,const char *docFile,int docLine
{
doc=d;
}
if (!_docsAlreadyAdded(doc))
if (!_docsAlreadyAdded(doc,m_impl->docSignatures))
{
//printf("setting docs for %s: `%s'\n",name().data(),m_doc.data());
if (m_impl->details==0)
......@@ -649,7 +652,7 @@ void Definition::_setBriefDescription(const char *b,const char *briefFile,int br
//printf("adding to details\n");
_setDocumentation(brief,briefFile,briefLine,FALSE,TRUE);
}
else if (!_docsAlreadyAdded(brief))
else if (!_docsAlreadyAdded(brief,m_impl->briefSignatures))
{
//fprintf(stderr,"Definition::setBriefDescription(%s,%s,%d)\n",b,briefFile,briefLine);
if (m_impl->brief==0)
......@@ -668,6 +671,10 @@ void Definition::_setBriefDescription(const char *b,const char *briefFile,int br
m_impl->brief->line = 1;
}
}
else
{
//printf("do nothing!\n");
}
}
void Definition::setBriefDescription(const char *b,const char *briefFile,int briefLine)
......@@ -1694,6 +1701,7 @@ QCString abbreviate(const char *s,const char *name)
QCString Definition::briefDescription(bool abbr) const
{
//printf("%s::briefDescription(%d)='%s'\n",name().data(),abbr,m_impl->brief?m_impl->brief->doc.data():"<none>");
return m_impl->brief ?
(abbr ? abbreviate(m_impl->brief->doc,displayName()) : m_impl->brief->doc) :
QCString("");
......
......@@ -352,7 +352,7 @@ class Definition : public DefinitionIntf
void _setBriefDescription(const char *b,const char *briefFile,int briefLine);
void _setDocumentation(const char *d,const char *docFile,int docLine,bool stripWhiteSpace,bool atTop);
void _setInbodyDocumentation(const char *d,const char *docFile,int docLine);
bool _docsAlreadyAdded(const QCString &doc);
bool _docsAlreadyAdded(const QCString &doc,QCString &sigList);
DefinitionImpl *m_impl; // internal structure holding all private data
QCString m_name;
bool m_isSymbol;
......
......@@ -883,6 +883,7 @@ void FTVHelp::generateLink(FTextStream &t,FTVNode *n)
static void generateBriefDoc(FTextStream &t,Definition *def)
{
QCString brief = def->briefDescription(TRUE);
//printf("*** %p: generateBriefDoc(%s)='%s'\n",def,def->name().data(),brief.data());
if (!brief.isEmpty())
{
DocNode *root = validatingParseDoc(def->briefFile(),def->briefLine(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment