From 2c3b327739b79d5ba7fe931e205bec1ad320b360 Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Thu, 8 Jan 2015 18:11:21 +0100 Subject: further extended the advanced document example, slightly improved XML serialization and fixed a bug in DemoOutput leading to errors if a section/paragraph had no heading. --- src/core/model/Domain.hpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/core/model') diff --git a/src/core/model/Domain.hpp b/src/core/model/Domain.hpp index 96e13c7..8d5de0c 100644 --- a/src/core/model/Domain.hpp +++ b/src/core/model/Domain.hpp @@ -261,11 +261,6 @@ protected: VisitorSet &visited) override; public: - /** - * Note, that this flag will always be set to "false" for non-primitive - * FieldDescriptors, because in that case the cardinalities regulate - * whether children have to be inserted or not. - */ const bool optional; // TODO: What about the name of default fields? @@ -305,15 +300,19 @@ public: * TREE for the main or default structure or SUBTREE * for supporting structures. * @param name is the name of this field. + * @param optional should be set to 'false' is this field needs to be + * filled in order for an instance of the parent + * Descriptor to be valid. */ FieldDescriptor(Manager &mgr, Handle parent, FieldType fieldType = FieldType::TREE, - std::string name = "") + std::string name = "", + bool optional = false) : Node(mgr, std::move(name), parent), children(this), fieldType(fieldType), // TODO: What would be a wise initialization of the primitiveType? - optional(false) + optional(optional) { } -- cgit v1.2.3