@@ -996,12 +996,18 @@ static QCString addTemplateNames(const QCString &s,const QCString &n,const QCStr
996996// ol.startParameterType(first=TRUE)
997997// ol.endParameterType
998998// ol.startParameterName
999- // ol.endParameterName(last==FALSE)
999+ // ol.endParameterName
1000+ // ol.startParameterExtra
1001+ // ol.startParameterDefVal [optional]
1002+ // ol.endParameterDefVal [optional]
1003+ // ol.endParameterExtra(last==FALSE)
10001004// ...
10011005// ol.startParameterType(first=FALSE)
10021006// ol.endParameterType
10031007// ol.startParameterName
1004- // ol.endParameterName(last==TRUE)
1008+ // ol.endParameterName
1009+ // ol.startParameterExtra
1010+ // ol.endParameterExtra(last==TRUE)
10051011// ...
10061012// --- leave writeDefArgumentList with return value TRUE
10071013// ol.endParameterList
@@ -1030,30 +1036,8 @@ static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const Me
10301036 if (!md->isDefine ()) ol.docify (" " );
10311037
10321038 // printf("writeDefArgList(%d)\n",defArgList->count());
1033- ol.pushGeneratorState ();
1034- // ol.disableAllBut(OutputType::Html);
1035- bool htmlOn = ol.isEnabled (OutputType::Html);
1036- bool latexOn = ol.isEnabled (OutputType::Latex);
1037- bool docbookOn = ol.isEnabled (OutputType::Docbook);
1038- {
1039- // html and latex
1040- if (htmlOn) ol.enable (OutputType::Html);
1041- if (latexOn) ol.enable (OutputType::Latex);
1042- if (docbookOn) ol.enable (OutputType::Docbook);
1043-
1044- ol.endMemberDocName ();
1045- ol.startParameterList (!md->isObjCMethod ());
1046- }
1047- ol.enableAll ();
1048- ol.disable (OutputType::Html);
1049- ol.disable (OutputType::Latex);
1050- ol.disable (OutputType::Docbook);
1051- {
1052- // other formats
1053- if (!md->isObjCMethod ()) ol.docify (" (" ); // start argument list
1054- ol.endMemberDocName ();
1055- }
1056- ol.popGeneratorState ();
1039+ ol.endMemberDocName ();
1040+ ol.startParameterList (!md->isObjCMethod ());
10571041 // printf("===> name=%s isDefine=%d\n",qPrint(md->name()),md->isDefine());
10581042
10591043 QCString cName;
@@ -1080,6 +1064,8 @@ static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const Me
10801064 }
10811065 // printf("~~~ %s cName=%s\n",qPrint(md->name()),qPrint(cName));
10821066
1067+ QCString sep = getLanguageSpecificSeparator (md->getLanguage (),true );
1068+
10831069 bool first=TRUE ;
10841070 bool paramTypeStarted=FALSE ;
10851071 bool isDefine = md->isDefine ();
@@ -1090,7 +1076,7 @@ static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const Me
10901076 if (isDefine || first)
10911077 {
10921078 ol.startParameterType (first,QCString ());
1093- paramTypeStarted=TRUE ;
1079+ paramTypeStarted=true ;
10941080 if (isDefine)
10951081 {
10961082 ol.endParameterType ();
@@ -1103,21 +1089,22 @@ static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const Me
11031089 ol.docify (a.attrib +" " );
11041090 }
11051091
1092+ QCString atype = a.type ;
1093+ if (sep!=" ::" ) { atype=substitute (atype," ::" ,sep); }
1094+
1095+ int funcPtrPos=-1 ;
11061096 {
1107- QCString n=a.type ;
1108- if (md->isObjCMethod ()) { n.prepend (" (" ); n.append (" )" ); }
1109- if (a.type !=" ..." )
1097+ if (md->isObjCMethod ()) { atype.prepend (" (" ); atype.append (" )" ); }
1098+ if (atype!=" ..." )
11101099 {
11111100 if (!cName.isEmpty () && scope && scope!=Doxygen::globalScope)
11121101 {
1113- n=addTemplateNames (n,scope->name (),cName);
1114- }
1115- QCString sep = getLanguageSpecificSeparator (md->getLanguage (),true );
1116- if (sep!=" ::" )
1117- {
1118- n=substitute (n," ::" ,sep);
1102+ atype=addTemplateNames (atype,scope->name (),cName);
11191103 }
1120- linkifyText (TextGeneratorOLImpl (ol),scope,md->getBodyDef (),md,n);
1104+ funcPtrPos = atype.find (" *)(" );
1105+ if (funcPtrPos!=-1 ) funcPtrPos++;
1106+ linkifyText (TextGeneratorOLImpl (ol),scope,md->getBodyDef (),md,
1107+ funcPtrPos==-1 ? atype : atype.left (funcPtrPos));
11211108 }
11221109 }
11231110
@@ -1130,26 +1117,32 @@ static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const Me
11301117 }
11311118 ol.startParameterName (defArgList.size ()<2 );
11321119 }
1133- if (!a. name . isEmpty () || a. type == " ... " ) // argument has a name
1120+ else
11341121 {
1135- ol.disable (OutputType::Latex);
1136- ol.disable (OutputType::Docbook);
1137- ol.disable (OutputType::Html);
1138- ol.docify (" " ); /* man page */
1139- if (htmlOn) ol.enable (OutputType::Html);
1140- ol.disable (OutputType::Man);
1141- ol.startEmphasis ();
1142- ol.enable (OutputType::Man);
1143- if (latexOn) ol.enable (OutputType::Latex);
1144- if (docbookOn) ol.enable (OutputType::Docbook);
1145- if (a.name .isEmpty ()) ol.docify (a.type ); else ol.docify (a.name );
1146- ol.disable (OutputType::Man);
1147- ol.disable (OutputType::Latex);
1148- ol.disable (OutputType::Docbook);
1149- ol.endEmphasis ();
1150- ol.enable (OutputType::Man);
1151- if (latexOn) ol.enable (OutputType::Latex);
1152- if (docbookOn) ol.enable (OutputType::Docbook);
1122+ ol.endParameterName ();
1123+ }
1124+
1125+ if (atype==" ..." )
1126+ {
1127+ ol.docify (atype);
1128+ }
1129+ else if (!a.name .isEmpty ()) // argument has a name
1130+ {
1131+ ol.docify (a.name );
1132+ }
1133+ if (!isDefine)
1134+ {
1135+ if (funcPtrPos!=-1 )
1136+ {
1137+ ol.writeNonBreakableSpace (1 );
1138+ }
1139+ ol.endParameterName ();
1140+ }
1141+ ol.startParameterExtra ();
1142+ if (funcPtrPos!=-1 )
1143+ {
1144+ linkifyText (TextGeneratorOLImpl (ol),scope,md->getBodyDef (),md,
1145+ atype.mid (funcPtrPos));
11531146 }
11541147 if (!a.array .isEmpty ())
11551148 {
@@ -1163,12 +1156,8 @@ static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const Me
11631156 n=addTemplateNames (n,scope->name (),cName);
11641157 }
11651158 ol.startParameterDefVal (" = " );
1166- // ol.docify(" = ");
1167- // ol.startTypewriter();
11681159 linkifyText (TextGeneratorOLImpl (ol),scope,md->getBodyDef (),md,n,FALSE ,TRUE ,TRUE );
1169- // ol.endTypewriter();
11701160 ol.endParameterDefVal ();
1171-
11721161 }
11731162 ++alIt;
11741163 if (alIt!=defArgList.end ())
@@ -1185,7 +1174,7 @@ static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const Me
11851174 key=a.attrib .mid (1 ,a.attrib .length ()-2 );
11861175 if (key!=" ," ) key+=" :" ; // for normal keywords add colon
11871176 }
1188- ol.endParameterName ( FALSE , FALSE ,!md->isObjCMethod ());
1177+ ol.endParameterExtra ( false , false ,!md->isObjCMethod ());
11891178 if (paramTypeStarted)
11901179 {
11911180 ol.endParameterType ();
@@ -1195,23 +1184,15 @@ static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const Me
11951184 }
11961185 else // isDefine
11971186 {
1198- ol.endParameterName ( FALSE , FALSE , TRUE );
1187+ ol.endParameterExtra ( false , false , true );
11991188 }
12001189 }
12011190 first=FALSE ;
12021191 }
1203- ol.pushGeneratorState ();
1204- ol.disable (OutputType::Html);
1205- ol.disable (OutputType::Latex);
1206- ol.disable (OutputType::Docbook);
1207- if (!md->isObjCMethod ()) ol.docify (" )" ); // end argument list
1208- ol.enableAll ();
1209- if (htmlOn) ol.enable (OutputType::Html);
1210- if (latexOn) ol.enable (OutputType::Latex);
1211- if (docbookOn) ol.enable (OutputType::Docbook);
12121192 if (first) ol.startParameterName (defArgList.size ()<2 );
1213- ol.endParameterName (TRUE ,defArgList.size ()<2 ,!md->isObjCMethod ());
1214- ol.popGeneratorState ();
1193+ ol.endParameterName ();
1194+ ol.startParameterExtra ();
1195+ ol.endParameterExtra (TRUE ,defArgList.size ()<2 ,!md->isObjCMethod ());
12151196 if (!md->extraTypeChars ().isEmpty ())
12161197 {
12171198 ol.docify (md->extraTypeChars ());
0 commit comments