From: spo Date: Thu, 6 Aug 2015 11:15:42 +0000 (+0300) Subject: Fix: test ModelAPI_TestUndoRedo X-Git-Tag: V_1.4.0_beta4~421 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5ed04ae2f4189218bbbb5ffec2973b71b324a11a;p=modules%2Fshaper.git Fix: test ModelAPI_TestUndoRedo --- 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(); }