From: vsv Date: Tue, 14 Jul 2015 13:10:54 +0000 (+0300) Subject: Issue #384: Crash on second creation of group is fixed X-Git-Tag: V_1.3.0~9 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=247d986b65461bb8aa710047f6c6e03b2fca400c;p=modules%2Fshaper.git Issue #384: Crash on second creation of group is fixed --- diff --git a/src/PartSet/PartSet_PartDataModel.cpp b/src/PartSet/PartSet_PartDataModel.cpp index 98eed0060..fff14f9d4 100644 --- a/src/PartSet/PartSet_PartDataModel.cpp +++ b/src/PartSet/PartSet_PartDataModel.cpp @@ -140,12 +140,19 @@ QVariant PartSet_PartDataModel::data(const QModelIndex& theIndex, int theRole) c case ConstructObject: case GroupObject: case BodiesObject: { - std::string aGroup = theIndex.internalId() == ConstructObject ? - ModelAPI_ResultConstruction::group() : ModelAPI_ResultBody::group(); - ObjectPtr anObject = aPartDoc->object(aGroup, theIndex.row()); - if (anObject && anObject->data() && - anObject->data()->execState() == ModelAPI_StateMustBeUpdated) { - return QIcon(":pictures/constr_object_modified.png"); + std::string aGroup; + if (theIndex.internalId() == ConstructObject) + aGroup = ModelAPI_ResultConstruction::group(); + else if (theIndex.internalId() == BodiesObject) + aGroup = ModelAPI_ResultBody::group(); + else if (theIndex.internalId() == GroupObject) + aGroup = ModelAPI_ResultGroup::group(); + if (aGroup.length() > 0) { + ObjectPtr anObject = aPartDoc->object(aGroup, theIndex.row()); + if (anObject && anObject->data() && + anObject->data()->execState() == ModelAPI_StateMustBeUpdated) { + return QIcon(":pictures/constr_object_modified.png"); + } } return QIcon(":pictures/constr_object.png"); }