From 60e823fd8e3c9b0b4d7a8f00f31e678235854061 Mon Sep 17 00:00:00 2001 From: spo Date: Thu, 6 Aug 2015 11:52:26 +0300 Subject: [PATCH] Fix: using wron label for expression --- src/Model/Model_Data.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Model/Model_Data.cpp b/src/Model/Model_Data.cpp index 0fa5d9203..0e8d64bd1 100644 --- a/src/Model/Model_Data.cpp +++ b/src/Model/Model_Data.cpp @@ -103,7 +103,8 @@ AttributePtr Model_Data::addAttribute(const std::string& theID, const std::strin anAttr = new Model_AttributeInteger(anAttrLab); } else if (theAttrType == ModelAPI_AttributeDouble::typeId()) { Model_AttributeDouble* anAttribute = new Model_AttributeDouble(anAttrLab); - anAttribute->myExpression.reset(new Model_Expression(myLab.FindChild(myLab.NbChildren() + 1))); + TDF_Label anExpressionLab = anAttrLab.FindChild(anAttrLab.NbChildren() + 1); + anAttribute->myExpression.reset(new Model_Expression(anExpressionLab)); anAttribute->myIsInitialized = anAttribute->myIsInitialized && anAttribute->myExpression->isInitialized(); anAttr = anAttribute; } else if (theAttrType == Model_AttributeBoolean::typeId()) { @@ -127,7 +128,8 @@ AttributePtr Model_Data::addAttribute(const std::string& theID, const std::strin else if (theAttrType == GeomData_Point::typeId()) { GeomData_Point* anAttribute = new GeomData_Point(anAttrLab); for (int aComponent = 0; aComponent < GeomData_Point::NUM_COMPONENTS; ++aComponent) { - anAttribute->myExpression[aComponent].reset(new Model_Expression(myLab.FindChild(myLab.NbChildren() + 1))); + TDF_Label anExpressionLab = anAttrLab.FindChild(anAttrLab.NbChildren() + 1); + anAttribute->myExpression[aComponent].reset(new Model_Expression(anExpressionLab)); anAttribute->myIsInitialized = anAttribute->myIsInitialized && anAttribute->myExpression[aComponent]->isInitialized(); } anAttr = anAttribute; @@ -136,7 +138,8 @@ AttributePtr Model_Data::addAttribute(const std::string& theID, const std::strin } else if (theAttrType == GeomData_Point2D::typeId()) { GeomData_Point2D* anAttribute = new GeomData_Point2D(anAttrLab); for (int aComponent = 0; aComponent < GeomData_Point2D::NUM_COMPONENTS; ++aComponent) { - anAttribute->myExpression[aComponent].reset(new Model_Expression(myLab.FindChild(myLab.NbChildren() + 1))); + TDF_Label anExpressionLab = anAttrLab.FindChild(anAttrLab.NbChildren() + 1); + anAttribute->myExpression[aComponent].reset(new Model_Expression(anExpressionLab)); anAttribute->myIsInitialized = anAttribute->myIsInitialized && anAttribute->myExpression[aComponent]->isInitialized(); } anAttr = anAttribute; -- 2.39.2