if( theIsUpdateDataModel ){
if( CAM_DataModel* aDataModel = dataModel() ){
if ( LightApp_DataModel* aModel = dynamic_cast<LightApp_DataModel*>( aDataModel ) ) {
+ SUIT_DataObject* aParent = NULL;
+ if(theDataObject && theDataObject != aDataModel->root())
+ aParent = theDataObject->parent();
+
LightApp_DataObject* anObject = dynamic_cast<LightApp_DataObject*>(theDataObject);
- SUIT_DataObject* aParent = anObject->parent();
- aModel->update( anObject, dynamic_cast<LightApp_Study*>( getApp()->activeStudy() ) );
+ LightApp_Study* aStudy = dynamic_cast<LightApp_Study*>(getApp()->activeStudy());
+ aModel->update( anObject, aStudy );
+
if(aParent && aParent->childPos(anObject) < 0)
aDataObject = dynamic_cast<LightApp_DataObject*>(aParent);
}