aboutsummaryrefslogtreecommitdiffstats
path: root/abstractmetabuilder.cpp
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-09-16 19:43:38 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-09 19:10:19 -0300
commit6b0d3bae3a0c015c3341a6d615a6b6d799322d8a (patch)
treee4bc27dc492b588a29736b9b63f4d494637b157e /abstractmetabuilder.cpp
parent35ab8b8e722b73a3a3ed9312379f6ab849252e19 (diff)
Fixed modifications to global functions.sb-0.10.7
Also added unit test. Reviewed by Luciano Wolf <luciano.wolf@openbossa.org> Reviewed by Renato Ara├║jo <renato.filho@openbossa.org>
Diffstat (limited to 'abstractmetabuilder.cpp')
-rw-r--r--abstractmetabuilder.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/abstractmetabuilder.cpp b/abstractmetabuilder.cpp
index 9fc1674d..c3ebe3b0 100644
--- a/abstractmetabuilder.cpp
+++ b/abstractmetabuilder.cpp
@@ -1945,8 +1945,16 @@ AbstractMetaFunction* AbstractMetaBuilder::traverseFunction(FunctionModelItem fu
//use relace-default-expression for set default value
QString replacedExpression;
- if (m_currentClass)
+ if (m_currentClass) {
replacedExpression = metaFunction->replacedDefaultExpression(m_currentClass, i + 1);
+ } else {
+ FunctionModificationList mods = TypeDatabase::instance()->functionModifications(metaFunction->minimalSignature());
+ if (!mods.isEmpty()) {
+ QList<ArgumentModification> argMods = mods.first().argument_mods;
+ if (!argMods.isEmpty())
+ replacedExpression = argMods.first().replacedDefaultExpression;
+ }
+ }
bool hasDefaultValue = false;
if (arg->defaultValue() || !replacedExpression.isEmpty()) {