From fa3fdcd27361dd8f5ddf43cd2bff2902df9d7435 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Thu, 18 Jan 2018 13:56:38 +0100 Subject: [PATCH] Fix for IfcPropertyEnumeratedValue padded profile --- src/ifcparse/IfcHdf5File.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/ifcparse/IfcHdf5File.cpp b/src/ifcparse/IfcHdf5File.cpp index 0c9ce4d821..197e7fb820 100644 --- a/src/ifcparse/IfcHdf5File.cpp +++ b/src/ifcparse/IfcHdf5File.cpp @@ -910,7 +910,18 @@ H5::DataType* type_mapper::operator()(const IfcParse::parameter_type* pt, const if (max_length_copy[0] == 0) max_length_copy[0] = 1; // Assume attribute lists are homogeneous and can be directly passed to supertypes - H5::DataType* element_dt = (*this)(pt->as_aggregation_type()->type_of_element(), instances, dims - 1, max_length + 1); + boost::optional< std::vector > instances_sub; + if (instances) { + instances_sub.emplace(); + const std::vector& instances_orig = *instances; + std::for_each(instances_orig.begin(), instances_orig.end(), [&instances_sub](Argument* attr) { + for (unsigned i = 0; i < attr->size(); ++i) { + (*instances_sub).push_back((*attr)[i]); + } + }); + } + + H5::DataType* element_dt = (*this)(pt->as_aggregation_type()->type_of_element(), instances_sub, dims - 1, max_length + 1); if (element_dt == nullptr) { // in case of select with all instance refs