From 5ed04ae2f4189218bbbb5ffec2973b71b324a11a Mon Sep 17 00:00:00 2001 From: spo Date: Thu, 6 Aug 2015 14:15:42 +0300 Subject: [PATCH] Fix: test ModelAPI_TestUndoRedo --- src/Model/Model_Data.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Model/Model_Data.cpp b/src/Model/Model_Data.cpp index c4aef0f96..504936dc1 100644 --- a/src/Model/Model_Data.cpp +++ b/src/Model/Model_Data.cpp @@ -108,7 +108,7 @@ 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); - TDF_Label anExpressionLab = anAttrLab.FindChild(anAttrLab.NbChildren() + 1); + TDF_Label anExpressionLab = anAttrLab.FindChild(1); anAttribute->myExpression.reset(new Model_Expression(anExpressionLab)); anAttribute->myIsInitialized = anAttribute->myIsInitialized && anAttribute->myExpression->isInitialized(); anAttr = anAttribute; @@ -133,7 +133,7 @@ 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) { - TDF_Label anExpressionLab = anAttrLab.FindChild(anAttrLab.NbChildren() + 1); + TDF_Label anExpressionLab = anAttrLab.FindChild(aComponent + 1); anAttribute->myExpression[aComponent].reset(new Model_Expression(anExpressionLab)); anAttribute->myIsInitialized = anAttribute->myIsInitialized && anAttribute->myExpression[aComponent]->isInitialized(); } @@ -143,7 +143,7 @@ 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) { - TDF_Label anExpressionLab = anAttrLab.FindChild(anAttrLab.NbChildren() + 1); + TDF_Label anExpressionLab = anAttrLab.FindChild(aComponent + 1); anAttribute->myExpression[aComponent].reset(new Model_Expression(anExpressionLab)); anAttribute->myIsInitialized = anAttribute->myIsInitialized && anAttribute->myExpression[aComponent]->isInitialized(); } -- 2.39.2