From ecb0fee0cda9b17fe1f9f0c2ba24b7d6e99d96fe Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Tue, 18 Jun 2019 14:28:57 +0200 Subject: [PATCH] Fix latebound enumeration writing in IfcConvert --- src/ifcconvert/IfcConvert.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ifcconvert/IfcConvert.cpp b/src/ifcconvert/IfcConvert.cpp index d284859cf5..49f707a93c 100644 --- a/src/ifcconvert/IfcConvert.cpp +++ b/src/ifcconvert/IfcConvert.cpp @@ -1125,13 +1125,13 @@ namespace latebound_access { auto i = decl->attribute_index(attr); auto attr_type = decl->attribute_by_index(i)->type_of_attribute(); - if (attr_type->as_named_type() && attr_type->as_named_type()->declared_type()->as_enumeration_type()) { + if (attr_type->as_named_type() && attr_type->as_named_type()->declared_type()->as_enumeration_type() && !std::is_same::value) { set_enumeration(inst, attr, attr_type->as_named_type()->declared_type()->as_enumeration_type(), t); + } else { + IfcWrite::IfcWriteArgument* a = new IfcWrite::IfcWriteArgument; + a->set(t); + inst->data().attributes()[i] = a; } - - IfcWrite::IfcWriteArgument* a = new IfcWrite::IfcWriteArgument; - a->set(t); - inst->data().attributes()[i] = a; } IfcUtil::IfcBaseClass* create(IfcParse::IfcFile& f, const std::string& entity) {