Doxygen linkifies arguments names
Aleksandr Platonov <[email protected]> Fri, 07 Jun 2013 18:59:45 +0400
| Newsgroups | gmane.text.doxygen.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi. I think that behavior described in subj. is incorrect, e.g. argument name could be the same as a typedef name https://bugzilla.gnome.org/show_bug.cgi?id=640156 The problem is in line 1660 of src/memberdef.cpp file: linkifyText() function is called for the whole argsString() thus arguments names could be linkified. I have created patch (see attachment) which replaces linkifyText() call at line 1660 with loop which calls linkifyText() for arguments types and default values and ol.writeString() for arguments names. This solution looks like dirty hack, but I have no idea how this problem could be solved in another way. Is it really problem or expected behavior? Could you take a look at my patch? -- Aleksandr Platonov ------------------------------------------------------------------------------ How ServiceNow helps IT people transform IT departments: 1. A cloud service to automate IT design, transition and operations 2. Dashboards that offer high-level views of enterprise services 3. A single system of record for all IT processes http://p.sf.net/sfu/servicenow-d2d-j _______________________________________________ Doxygen-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/doxygen-develop
memberdef.cpp.patch
(text/x-patch, 3.4 KB)
diff --git a/src/memberdef.cpp b/src/memberdef.cpp
index c5bf787..784dc54 100644
--- a/src/memberdef.cpp
+++ b/src/memberdef.cpp
@@ -1657,16 +1657,71 @@ void MemberDef::writeDeclaration(OutputList &ol,
if (argsString() && !isObjCMethod())
{
if (!isDefine()) ol.writeString(" ");
- linkifyText(TextGeneratorOLImpl(ol), // out
- d, // scope
- getBodyDef(), // fileScope
- this, // self
- argsString(), // text
- m_impl->annMemb, // autoBreak
- TRUE, // external
- FALSE, // keepSpaces
- s_indentLevel
- );
+
+ /* prevent links generation for function arguments names */
+ if (isFunction())
+ {
+ ol.writeString("(");
+ ArgumentListIterator al(*m_impl->declArgList);
+ Argument *arg;
+ int i;
+ /* for each argument */
+ for (i = 0; (arg = al.current()); ++al, i++)
+ {
+ /* write arguments separator */
+ if (i != 0)
+ ol.writeString(", ");
+
+ /* write argument type with links creation */
+ linkifyText(TextGeneratorOLImpl(ol), // out
+ d, // scope
+ getBodyDef(), // fileScope
+ this, // self
+ arg->type, // text
+ m_impl->annMemb, // autoBreak
+ TRUE, // external
+ FALSE, // keepSpaces
+ s_indentLevel
+ );
+ if (arg->name.isEmpty())
+ continue;
+ ol.writeString(" ");
+ /* write argument name, do not try to generate link for it */
+ ol.writeString(arg->name.data());
+ if (!arg->array.isEmpty())
+ ol.writeString(arg->array.data());
+
+ /* write default agrument value with links creation */
+ if (!arg->defval.isEmpty())
+ {
+ ol.writeString("=");
+ linkifyText(TextGeneratorOLImpl(ol), // out
+ d, // scope
+ getBodyDef(), // fileScope
+ this, // self
+ arg->defval, // text
+ m_impl->annMemb, // autoBreak
+ TRUE, // external
+ FALSE, // keepSpaces
+ s_indentLevel
+ );
+ }
+ }
+ ol.writeString(")");
+ }
+ else
+ {
+ linkifyText(TextGeneratorOLImpl(ol), // out
+ d, // scope
+ getBodyDef(), // fileScope
+ this, // self
+ argsString(), // text
+ m_impl->annMemb, // autoBreak
+ TRUE, // external
+ FALSE, // keepSpaces
+ s_indentLevel
+ );
+ }
}
// *** write exceptions
if (excpString())