]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Apply debug on UpdateObjBrowser functionality
authorapo <apo@opencascade.com>
Mon, 12 Dec 2005 12:55:58 +0000 (12:55 +0000)
committerapo <apo@opencascade.com>
Mon, 12 Dec 2005 12:55:58 +0000 (12:55 +0000)
src/LightApp/LightApp_Module.cxx

index dfa6cc6c53b75e095cefbba51eef4ff60b3377f5..8db02d3be8f2b4720f0cabe9c5e1973497e81fee 100644 (file)
@@ -100,9 +100,14 @@ void LightApp_Module::updateObjBrowser( bool theIsUpdateDataModel,
   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);
       }