Commit f9c9edba authored by Dimitri van Heesch's avatar Dimitri van Heesch

Bug 704090 - Allow Class{T}.Method in cref to refer to a generic class in XML comments

parent fa239ea9
...@@ -232,6 +232,23 @@ static void docParserPopContext(bool keepParamInfo=FALSE) ...@@ -232,6 +232,23 @@ static void docParserPopContext(bool keepParamInfo=FALSE)
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// replaces { with < and } with > inside string s
static void unescapeCRef(QCString &s)
{
char *p = s.data();
if (p)
{
char c;
while ((c=*p))
{
if (c=='{') c='<'; else if (c=='}') c='>';
*p++=c;
}
}
}
//---------------------------------------------------------------------------
/*! search for an image in the imageNameDict and if found /*! search for an image in the imageNameDict and if found
* copies the image to the output directory (which depends on the \a type * copies the image to the output directory (which depends on the \a type
* parameter). * parameter).
...@@ -6045,6 +6062,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta ...@@ -6045,6 +6062,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
QCString exceptName; QCString exceptName;
if (findAttribute(tagHtmlAttribs,"cref",&exceptName)) if (findAttribute(tagHtmlAttribs,"cref",&exceptName))
{ {
unescapeCRef(exceptName);
retval = handleParamSection(exceptName,DocParamSect::Exception,TRUE); retval = handleParamSection(exceptName,DocParamSect::Exception,TRUE);
} }
else else
...@@ -6089,6 +6107,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta ...@@ -6089,6 +6107,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
//printf("XML_SEE: empty tag=%d\n",g_token->emptyTag); //printf("XML_SEE: empty tag=%d\n",g_token->emptyTag);
if (findAttribute(tagHtmlAttribs,"cref",&cref)) if (findAttribute(tagHtmlAttribs,"cref",&cref))
{ {
unescapeCRef(cref);
if (g_token->emptyTag) // <see cref="..."/> style if (g_token->emptyTag) // <see cref="..."/> style
{ {
bool inSeeBlock = g_inSeeBlock; bool inSeeBlock = g_inSeeBlock;
...@@ -6123,6 +6142,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta ...@@ -6123,6 +6142,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
QCString cref; QCString cref;
if (findAttribute(tagHtmlAttribs,"cref",&cref)) if (findAttribute(tagHtmlAttribs,"cref",&cref))
{ {
unescapeCRef(cref);
// Look for an existing "see" section // Look for an existing "see" section
DocSimpleSect *ss=0; DocSimpleSect *ss=0;
QListIterator<DocNode> cli(m_children); QListIterator<DocNode> cli(m_children);
......
...@@ -4716,6 +4716,7 @@ bool resolveLink(/* in */ const char *scName, ...@@ -4716,6 +4716,7 @@ bool resolveLink(/* in */ const char *scName,
*resContext=0; *resContext=0;
QCString linkRef=lr; QCString linkRef=lr;
QCString linkRefWithoutTemplates = stripTemplateSpecifiersFromScope(linkRef,FALSE);
//printf("ResolveLink linkRef=%s inSee=%d\n",lr,inSeeBlock); //printf("ResolveLink linkRef=%s inSee=%d\n",lr,inSeeBlock);
FileDef *fd; FileDef *fd;
GroupDef *gd; GroupDef *gd;
...@@ -4772,6 +4773,12 @@ bool resolveLink(/* in */ const char *scName, ...@@ -4772,6 +4773,12 @@ bool resolveLink(/* in */ const char *scName,
resAnchor=cd->anchor(); resAnchor=cd->anchor();
return TRUE; return TRUE;
} }
else if ((cd=getClass(linkRefWithoutTemplates))) // C#/Java generic class link
{
*resContext=cd;
resAnchor=cd->anchor();
return TRUE;
}
else if ((cd=getClass(linkRef+"-p"))) // Obj-C protocol link else if ((cd=getClass(linkRef+"-p"))) // Obj-C protocol link
{ {
*resContext=cd; *resContext=cd;
......
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