summaryrefslogtreecommitdiffstats
path: root/src/util.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 2035bb3..741291c 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -1909,7 +1909,7 @@ bool matchArguments(ArgumentList *srcAl,ArgumentList *dstAl,
// merges the initializer of two argument lists
// pre: the types of the arguments in the list should match.
-void mergeArguments(ArgumentList *srcAl,ArgumentList *dstAl)
+void mergeArguments(ArgumentList *srcAl,ArgumentList *dstAl,bool forceNameOverwrite)
{
//printf("mergeArguments `%s', `%s'\n",
// argListToString(srcAl).data(),argListToString(dstAl).data());
@@ -1951,13 +1951,20 @@ void mergeArguments(ArgumentList *srcAl,ArgumentList *dstAl)
}
else if (!srcA->name.isEmpty() && !dstA->name.isEmpty())
{
- if (srcA->docs.isEmpty() && !dstA->docs.isEmpty())
+ if (forceNameOverwrite)
{
srcA->name = dstA->name.copy();
}
- else if (!srcA->docs.isEmpty() && dstA->docs.isEmpty())
+ else
{
- dstA->name = srcA->name.copy();
+ if (srcA->docs.isEmpty() && !dstA->docs.isEmpty())
+ {
+ srcA->name = dstA->name.copy();
+ }
+ else if (!srcA->docs.isEmpty() && dstA->docs.isEmpty())
+ {
+ dstA->name = srcA->name.copy();
+ }
}
}
}