Apply modified patch 2879724 from Marko Klopcic

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-cherylfoil@11716 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2009-11-01 22:05:01 +00:00
commit 06269a50a5
2 changed files with 13 additions and 3 deletions

View file

@ -19,6 +19,13 @@ PyDocConverter::PyDocConverter() {
}
std::string PyDocConverter::formatParam(Node *n, DoxygenEntity & doxygenEntity) {
if (doxygenEntity.entityList.size() < 2) {
/* if 'paramDescriptionEntity' is not there, ignore param. Better than crash!
TODO: log error! */
return "";
}
ParmList *plist = CopyParmList(Getattr(n, "parms"));
Parm *p = NULL;
@ -34,7 +41,10 @@ std::string PyDocConverter::formatParam(Node *n, DoxygenEntity & doxygenEntity)
std::string type = Char(Swig_name_make(n, 0, Getattr(p, "type"), 0, 0));
result = name + " (" + type + ") ";
result.resize(DOC_PARAM_STRING_LENGTH - 3, ' ');
if (result.size() < (DOC_PARAM_STRING_LENGTH - 3)) {
/* do not cut info away - it is better to have not so nice output than type information missing. */
result.resize(DOC_PARAM_STRING_LENGTH - 3, ' ');
}
result += "-- " + paramDescription.substr(DOC_PARAM_STRING_LENGTH);
break;
}