Skip to content
Snippets Groups Projects
Commit 1738dc69 authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer Committed by hjk
Browse files

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
(cherry picked from commit ee6d7ae3)
parent 184f8301
No related branches found
No related tags found
No related merge requests found
...@@ -87,7 +87,7 @@ QString TypePrettyPrinter::operator()(const FullySpecifiedType &ty) ...@@ -87,7 +87,7 @@ QString TypePrettyPrinter::operator()(const FullySpecifiedType &ty)
bool previousNeedsParens = switchNeedsParens(false); bool previousNeedsParens = switchNeedsParens(false);
acceptType(ty); acceptType(ty);
switchNeedsParens(previousNeedsParens); switchNeedsParens(previousNeedsParens);
return switchText(previousName).trimmed(); return switchText(previousName);
} }
QString TypePrettyPrinter::operator()(const FullySpecifiedType &type, const QString &name) QString TypePrettyPrinter::operator()(const FullySpecifiedType &type, const QString &name)
...@@ -317,8 +317,11 @@ void TypePrettyPrinter::visit(Function *type) ...@@ -317,8 +317,11 @@ void TypePrettyPrinter::visit(Function *type)
} }
if (_overview->showReturnTypes()) { if (_overview->showReturnTypes()) {
const QString returnType = _overview->prettyType(type->returnType());
if (!returnType.isEmpty()) {
_text.prepend(QLatin1Char(' ')); _text.prepend(QLatin1Char(' '));
_text.prepend(_overview->prettyType(type->returnType())); _text.prepend(returnType);
}
} }
if (_overview->showFunctionSignatures()) { if (_overview->showFunctionSignatures()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment