aboutsummaryrefslogtreecommitdiffstats
path: root/shibokengenerator.cpp
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2009-12-28 16:51:08 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2009-12-28 16:51:08 -0300
commit731a68999274ab58fb35f3d3238f713fbf91c878 (patch)
treea6ceccd4e61199b2a2e7f45029ffe33686632620 /shibokengenerator.cpp
parente489074ccb5bf5b98564d9752907a5657506f4e4 (diff)
Modifies ShibokenGenerator::writeCodeSnips semantics.
A NULL pointer in the "lastArg" parameter of writeCodeSnips means that the function being processed will be called without arguments. The behavior prior to this change was that a NULL lastArg indicates that all arguments are to be used.
Diffstat (limited to 'shibokengenerator.cpp')
-rw-r--r--shibokengenerator.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/shibokengenerator.cpp b/shibokengenerator.cpp
index d8b4aefb2..933aca5fa 100644
--- a/shibokengenerator.cpp
+++ b/shibokengenerator.cpp
@@ -930,14 +930,13 @@ void ShibokenGenerator::writeCodeSnips(QTextStream& s,
const AbstractMetaArgument* arg = func->arguments().at(i);
QString argReplacement;
if (snip.language == TypeSystem::TargetLangCode) {
- if (func->argumentRemoved(i+1)) {
+ if (!lastArg || func->argumentRemoved(i+1)) {
if (!arg->defaultValueExpression().isEmpty())
argReplacement = arg->defaultValueExpression();
removed++;
- }
-
- if (lastArg && arg->argumentIndex() > lastArg->argumentIndex())
+ } else if (lastArg && (arg->argumentIndex() > lastArg->argumentIndex())) {
argReplacement = arg->defaultValueExpression();
+ }
if (argReplacement.isEmpty()) {
argReplacement = QString("cpp_arg%1").arg(i - removed);