summaryrefslogtreecommitdiffstats
path: root/src/util.cpp
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2018-07-12 12:19:00 (GMT)
committeralbert-github <albert.tests@gmail.com>2018-07-12 12:19:00 (GMT)
commit858d65a9cd7b9b7cf71da01098f47d583b3322f5 (patch)
tree965217503677442e224e80549bee3d0aea3a7857 /src/util.cpp
parent5b735d5118581e3bca686f79de341b8b2e76691f (diff)
parent56c60e84e6dd6d7e4e7774be24d1402782fd3230 (diff)
downloadDoxygen-858d65a9cd7b9b7cf71da01098f47d583b3322f5.zip
Doxygen-858d65a9cd7b9b7cf71da01098f47d583b3322f5.tar.gz
Doxygen-858d65a9cd7b9b7cf71da01098f47d583b3322f5.tar.bz2
Merge branch 'feature/bug_tableofcontents_latex' of https://github.com/albert-github/doxygen into feature/bug_tableofcontents_latex
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp30
1 files changed, 13 insertions, 17 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 9762892..ea68cd7 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -323,7 +323,6 @@ int guessSection(const char *name)
n.right(4)==".c++" ||
n.right(5)==".java" ||
n.right(2)==".m" ||
- n.right(2)==".M" ||
n.right(3)==".mm" ||
n.right(3)==".ii" || // inline
n.right(4)==".ixx" ||
@@ -1782,7 +1781,7 @@ QCString removeRedundantWhiteSpace(const QCString &s)
pc = c;
i++;
c = src[i];
- *dst+=c;
+ *dst++=c;
}
else if (c=='"')
{
@@ -7395,23 +7394,23 @@ int nextUtf8CharPosition(const QCString &utf8Str,int len,int startPos)
{
if (((uchar)c&0xE0)==0xC0)
{
- bytes++; // 11xx.xxxx: >=2 byte character
+ bytes+=1; // 11xx.xxxx: >=2 byte character
}
if (((uchar)c&0xF0)==0xE0)
{
- bytes++; // 111x.xxxx: >=3 byte character
+ bytes+=2; // 111x.xxxx: >=3 byte character
}
if (((uchar)c&0xF8)==0xF0)
{
- bytes++; // 1111.xxxx: >=4 byte character
+ bytes+=3; // 1111.xxxx: >=4 byte character
}
if (((uchar)c&0xFC)==0xF8)
{
- bytes++; // 1111.1xxx: >=5 byte character
+ bytes+=4; // 1111.1xxx: >=5 byte character
}
if (((uchar)c&0xFE)==0xFC)
{
- bytes++; // 1111.1xxx: 6 byte character
+ bytes+=5; // 1111.1xxx: 6 byte character
}
}
else if (c=='&') // skip over character entities
@@ -7445,11 +7444,10 @@ QCString parseCommentAsText(const Definition *scope,const MemberDef *md,
root->accept(visitor);
delete visitor;
delete root;
- QCString result = convertCharEntitiesToUTF8(s.data());
+ QCString result = convertCharEntitiesToUTF8(s.data()).stripWhiteSpace();
int i=0;
int charCnt=0;
int l=result.length();
- bool addEllipsis=FALSE;
while ((i=nextUtf8CharPosition(result,l,i))<l)
{
charCnt++;
@@ -7460,19 +7458,17 @@ QCString parseCommentAsText(const Definition *scope,const MemberDef *md,
while ((i=nextUtf8CharPosition(result,l,i))<l && charCnt<100)
{
charCnt++;
- if (result.at(i)>=0 && isspace(result.at(i)))
- {
- addEllipsis=TRUE;
- }
- else if (result.at(i)==',' ||
- result.at(i)=='.' ||
- result.at(i)=='?')
+ if (result.at(i)==',' ||
+ result.at(i)=='.' ||
+ result.at(i)=='!' ||
+ result.at(i)=='?')
{
+ i++; // we want to be "behind" last inspected character
break;
}
}
}
- if (addEllipsis || charCnt==100) result=result.left(i)+"...";
+ if ( i < l) result=result.left(i)+"...";
return result.data();
}