Skip to content
GitLab
Menu
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
4623f11f
Commit
4623f11f
authored
Sep 22, 2010
by
Erik Verbruggen
Browse files
C++: only activate insert-declaration quickfix only on the declaration-id.
parent
70e0e5f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/cppeditor/cppinsertdecldef.cpp
View file @
4623f11f
...
...
@@ -116,10 +116,22 @@ QList<CppQuickFixOperation::Ptr> DeclFromDef::match(const CppQuickFixState &stat
int
idx
=
0
;
for
(;
idx
<
path
.
size
();
++
idx
)
{
AST
*
node
=
path
.
at
(
idx
);
if
(
FunctionDefinitionAST
*
candidate
=
node
->
asFunctionDefinition
())
{
if
(
!
funDef
&&
file
.
isCursorOn
(
candidate
)
&&
!
file
.
isCursorOn
(
candidate
->
function_body
))
funDef
=
candidate
;
}
else
if
(
node
->
asClassSpecifier
())
{
if
(
idx
>
1
)
{
if
(
DeclaratorIdAST
*
declId
=
node
->
asDeclaratorId
())
{
if
(
file
.
isCursorOn
(
declId
))
{
if
(
FunctionDefinitionAST
*
candidate
=
path
.
at
(
idx
-
2
)
->
asFunctionDefinition
())
{
if
(
funDef
)
{
return
noResult
();
}
else
{
funDef
=
candidate
;
break
;
}
}
}
}
}
if
(
node
->
asClassSpecifier
())
{
return
noResult
();
}
}
...
...
@@ -156,7 +168,7 @@ QList<CppQuickFixOperation::Ptr> DeclFromDef::match(const CppQuickFixState &stat
InsertionPointLocator
::
PrivateSlot
,
decl
)));
return
results
;
}
//! \todo support insertion into namespaces
}
//! \todo support insertion
of non-methods
into namespaces
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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