aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/cplusplus/TypePrettyPrinter.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2010-05-27 14:46:22 +0200
committerThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2010-05-27 14:49:45 +0200
commitee6d7ae3848aa3c23176ff5f4e205b13d71f6b25 (patch)
tree0db33efa30694c3b3aa1e0a6c4bc72d4f32deeee /src/libs/cplusplus/TypePrettyPrinter.cpp
parent272de3b8819510c8016bc0598fb1bbeefb85fdfd (diff)
Fixed position of current argument highlight for constructors
It was broken due to a leading space which was trimmed off, breaking the begin and end positions. Instead, don't trim, but just make sure not to add a leading space when it is not necessary. Done-with: Christian Kamm <christian.d.kamm@nokia.com> Task-number: QTCREATORBUG-1398
Diffstat (limited to 'src/libs/cplusplus/TypePrettyPrinter.cpp')
-rw-r--r--src/libs/cplusplus/TypePrettyPrinter.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libs/cplusplus/TypePrettyPrinter.cpp b/src/libs/cplusplus/TypePrettyPrinter.cpp
index 7126ce2ac4..e1277f2726 100644
--- a/src/libs/cplusplus/TypePrettyPrinter.cpp
+++ b/src/libs/cplusplus/TypePrettyPrinter.cpp
@@ -87,7 +87,7 @@ QString TypePrettyPrinter::operator()(const FullySpecifiedType &ty)
bool previousNeedsParens = switchNeedsParens(false);
acceptType(ty);
switchNeedsParens(previousNeedsParens);
- return switchText(previousName).trimmed();
+ return switchText(previousName);
}
QString TypePrettyPrinter::operator()(const FullySpecifiedType &type, const QString &name)
@@ -317,8 +317,11 @@ void TypePrettyPrinter::visit(Function *type)
}
if (_overview->showReturnTypes()) {
- _text.prepend(QLatin1Char(' '));
- _text.prepend(_overview->prettyType(type->returnType()));
+ const QString returnType = _overview->prettyType(type->returnType());
+ if (!returnType.isEmpty()) {
+ _text.prepend(QLatin1Char(' '));
+ _text.prepend(returnType);
+ }
}
if (_overview->showFunctionSignatures()) {