Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
63a5f15f
Commit
63a5f15f
authored
Feb 03, 2009
by
Thorbjørn Lindeijer
Browse files
Don't replace . with -> in case of primitive types
Reviewed-by: Roberto Raggi
parent
b100baed
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/cpptools/cppcodecompletion.cpp
View file @
63a5f15f
...
...
@@ -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
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment