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
This commit is contained in:
Thorbjørn Lindeijer
2010-05-27 14:46:22 +02:00
parent 272de3b881
commit ee6d7ae384

View File

@@ -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()) {