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

Reviewed-by: Roberto Raggi
This commit is contained in:
Thorbjørn Lindeijer
2009-02-03 11:37:38 +01:00
parent b100baedcd
commit 63a5f15f9d

View File

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