summaryrefslogtreecommitdiffstats
path: root/src/definition.cpp
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2002-12-16 20:08:24 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2002-12-16 20:08:24 (GMT)
commit1a8ff6f0e75b0db2a4ff1f5eb63631c94085b01e (patch)
tree0de7715d3a2308f07d2c97970d88def415c52ae4 /src/definition.cpp
parent6204682e5f23d154bade70d60f5989424f057ce6 (diff)
downloadDoxygen-1a8ff6f0e75b0db2a4ff1f5eb63631c94085b01e.zip
Doxygen-1a8ff6f0e75b0db2a4ff1f5eb63631c94085b01e.tar.gz
Doxygen-1a8ff6f0e75b0db2a4ff1f5eb63631c94085b01e.tar.bz2
Release-1.3-rc2
Diffstat (limited to 'src/definition.cpp')
-rw-r--r--src/definition.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/definition.cpp b/src/definition.cpp
index f3b556a..46d66a9 100644
--- a/src/definition.cpp
+++ b/src/definition.cpp
@@ -122,7 +122,28 @@ void Definition::setDocumentation(const char *d,const char *docFile,int docLine,
if (d==0) return;
//printf("Definition::setDocumentation(%s,%s,%d)\n",d,docFile,docLine);
if (stripWhiteSpace)
- m_doc=((QCString)d).stripWhiteSpace();
+ {
+ // strip leading empty lines in front of the text, but not the
+ // leading spaces in front of the first line, so list items are
+ // parsed with the correct indent
+ const char *p=d;
+ char c;
+ int s=0,so=0;
+ while ((c=*p) && (c==' ' || c=='\r' || c=='\n'))
+ {
+ if (c=='\n') so=s;
+ p++;
+ s++;
+ }
+ m_doc=d+so;
+ // zero any trailing whitespace
+ int e=m_doc.length()-1;
+ while (e>=0 && (c=m_doc.at(e)) && (c==' ' || c=='\r' || c=='\n'))
+ {
+ m_doc.at(e)='\0';
+ e--;
+ }
+ }
else
m_doc=d;
m_docFile = docFile;