From a0719a9a3e1c0970c0207fa4beec150613f1a768 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Wed, 18 Feb 2015 00:07:42 +0100 Subject: Fixed bug #80 and added unit test --- src/core/model/Domain.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core/model') diff --git a/src/core/model/Domain.cpp b/src/core/model/Domain.cpp index f6c3956..ca8f889 100644 --- a/src/core/model/Domain.cpp +++ b/src/core/model/Domain.cpp @@ -566,7 +566,7 @@ bool Descriptor::addAndSortFieldDescriptor(Handle fd, if (fds.find(fd) == fds.end()) { invalidate(); // check if the previous field is a tree field already. - if (!fds.empty() && + if (!fds.empty() && !fieldDescriptors.empty() && fds.back()->getFieldType() == FieldDescriptor::FieldType::TREE && fd->getFieldType() != FieldDescriptor::FieldType::TREE) { // if so we add the new field before the TREE field. @@ -961,4 +961,4 @@ const Rtti Domain = RttiBuilder("Domain") .parent(&RootNode) .composedOf({&StructuredClass, &AnnotationClass}); } -} \ No newline at end of file +} -- cgit v1.2.3