CtrlCore: Fixed workares issue in X11/GTK, various cosmetics

git-svn-id: svn://ultimatepp.org/upp/trunk@7336 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2014-04-28 16:55:48 +00:00
parent f59fe47620
commit e2b5d44cc8
32 changed files with 87 additions and 56 deletions

View file

@ -991,7 +991,7 @@ WString ASBeautifier::beautify(const WString &originalLine)
}
// handle quotes (such as 'x' and "Hello Dolly")
if (!(isInComment || isInLineComment) && (ch == '"' || ch == '\''))
if (!(isInComment || isInLineComment) && (ch == '"' || ch == '\'')) {
if (!isInQuote)
{
quoteChar = ch;
@ -1003,6 +1003,7 @@ WString ASBeautifier::beautify(const WString &originalLine)
isInStatement = true;
continue;
}
}
if (isInQuote)
continue;
@ -1621,11 +1622,12 @@ WString ASBeautifier::beautify(const WString &originalLine)
// that both an assignment op and a non-assignment op where found,
// e.g. '>>' and '>>='. If this is the case, treat the LONGER one as the
// found operator.
if (foundAssignmentOp != NULL && foundNonAssignmentOp != NULL)
if (foundAssignmentOp != NULL && foundNonAssignmentOp != NULL) {
if (foundAssignmentOp->GetCount() < foundNonAssignmentOp->GetCount())
foundAssignmentOp = NULL;
else
foundNonAssignmentOp = NULL;
}
if (foundNonAssignmentOp != NULL)
{

View file

@ -217,7 +217,7 @@ void ASEnhancer::enhance(WString &line)
}
// handle quotes (such as 'x' and "Hello Dolly")
if (!(isInComment) && (ch == '"' || ch == '\''))
if (!(isInComment) && (ch == '"' || ch == '\'')) {
if (!isInQuote)
{
quoteChar = ch;
@ -228,6 +228,7 @@ void ASEnhancer::enhance(WString &line)
isInQuote = false;
continue;
}
}
if (isInQuote)
continue;
@ -335,11 +336,12 @@ void ASEnhancer::enhance(WString &line)
}
for (; i < lineLength; i++) // bypass colon
{
if (line[i] == ':')
if (line[i] == ':') {
if ((i + 1 < lineLength) && (line[i + 1] == ':'))
i++; // bypass scope resolution operator
else
break;
}
}
i++;
for (; i < lineLength; i++) // bypass whitespace