mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 01:50:01 +00:00
Correct setting attributes on lazily loaded instances
This commit is contained in:
@@ -1008,6 +1008,10 @@ Argument* IfcEntityInstanceData::getArgument(unsigned int i) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void IfcEntityInstanceData::setArgument(unsigned int i, Argument* a, IfcUtil::ArgumentType attr_type) {
|
void IfcEntityInstanceData::setArgument(unsigned int i, Argument* a, IfcUtil::ArgumentType attr_type) {
|
||||||
|
if (!initialized_) {
|
||||||
|
load_();
|
||||||
|
}
|
||||||
|
|
||||||
while (attributes_.size() < i) {
|
while (attributes_.size() < i) {
|
||||||
attributes_.push_back(new NullArgument());
|
attributes_.push_back(new NullArgument());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ HeaderEntity::HeaderEntity(const char * const datatype, IfcFile* file)
|
|||||||
if (file) {
|
if (file) {
|
||||||
offset_in_file_ = file->stream->Tell();
|
offset_in_file_ = file->stream->Tell();
|
||||||
load_();
|
load_();
|
||||||
|
} else {
|
||||||
|
initialized_ = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user