Commit 63a5f15f authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer
Browse files

Don't replace . with -> in case of primitive types

Reviewed-by: Roberto Raggi
parent b100baed
......@@ -689,12 +689,14 @@ bool CppCodeCompletion::completeMember(const QList<TypeOfExpression::Result> &re
}
if (PointerType *ptrTy = ty->asPointerType()) {
// Replace . with ->
int length = m_editor->position() - m_startPosition + 1;
m_editor->setCurPos(m_startPosition - 1);
m_editor->replace(length, QLatin1String("->"));
++m_startPosition;
namedTy = ptrTy->elementType()->asNamedType();
if (ptrTy->elementType()->isNamedType()) {
// Replace . with ->
int length = m_editor->position() - m_startPosition + 1;
m_editor->setCurPos(m_startPosition - 1);
m_editor->replace(length, QLatin1String("->"));
++m_startPosition;
namedTy = ptrTy->elementType()->asNamedType();
}
} else {
namedTy = ty->asNamedType();
if (! namedTy) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment