From 4a679812cacf175b058b156f4dccadd9f1e87288 Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Fri, 4 Feb 2022 13:54:07 +0100 Subject: [PATCH] #2018 prevent select types to be serialized as booleans --- src/ifcparse/IfcWrite.cpp | 4 ++-- src/ifcparse/IfcWrite.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ifcparse/IfcWrite.cpp b/src/ifcparse/IfcWrite.cpp index 4ff08eec48..2adabed7f8 100644 --- a/src/ifcparse/IfcWrite.cpp +++ b/src/ifcparse/IfcWrite.cpp @@ -289,9 +289,9 @@ void IfcWriteArgument::set(const aggregate_of_aggregate_of_instance::ptr& v) { } // Overload to detect null values -void IfcWriteArgument::set(IfcUtil::IfcBaseClass*const& v) { +void IfcWriteArgument::set(IfcUtil::IfcBaseInterface*const& v) { if (v) { - container = v; + container = v->as(); } else { container = boost::blank(); } diff --git a/src/ifcparse/IfcWrite.h b/src/ifcparse/IfcWrite.h index 502ec21f1e..c69ca6052b 100644 --- a/src/ifcparse/IfcWrite.h +++ b/src/ifcparse/IfcWrite.h @@ -129,7 +129,7 @@ namespace IfcWrite { } template - typename boost::disable_if::type>, void>::type + typename boost::disable_if::type>, void>::type set(const T& t) { container = t; } @@ -141,7 +141,7 @@ namespace IfcWrite { void set(const aggregate_of_aggregate_of_instance::ptr& v); // Overload to detect null values - void set(IfcUtil::IfcBaseClass*const & v); + void set(IfcUtil::IfcBaseInterface*const & v); operator int() const; operator bool() const;