summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2014-12-28 12:16:23 +0100
committerAndreas Stöckel <andreas@somweyr.de>2014-12-28 12:16:23 +0100
commit171d6b233690f7b0ed01450e1d993b246fe42ed3 (patch)
tree25b6e56df4c51f04cac4d08314e5c6c2c7c047be /src/core
parent3f22fdbf6aa5d4543c122a91cf244046697a1ec9 (diff)
fixed insertion of attribute default values in the StructType.insert function
Diffstat (limited to 'src/core')
-rw-r--r--src/core/model/Typesystem.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/model/Typesystem.cpp b/src/core/model/Typesystem.cpp
index 4a2f4eb..561692a 100644
--- a/src/core/model/Typesystem.cpp
+++ b/src/core/model/Typesystem.cpp
@@ -344,7 +344,11 @@ Variant StructType::create() const
Variant::arrayType arr;
arr.resize(attributes.size());
for (size_t idx = 0; idx < attributes.size(); idx++) {
- arr[idx] = attributes[idx]->getType()->create();
+ if (attributes[idx]->optional) {
+ arr[idx] = attributes[idx]->defaultValue;
+ } else {
+ arr[idx] = attributes[idx]->getType()->create();
+ }
}
return arr;
}