From 171d6b233690f7b0ed01450e1d993b246fe42ed3 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Sun, 28 Dec 2014 12:16:23 +0100 Subject: fixed insertion of attribute default values in the StructType.insert function --- src/core/model/Typesystem.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') 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; } -- cgit v1.2.3