- Handle(SALOME_TypeFilter) meshFilter = new SALOME_TypeFilter( "MESH" );
- if ( !meshFilter->IsOk(anObj) )
- return false;
+ bool Ok = false, extractReference = true;
+
+ const LightApp_DataOwner* owner =
+ dynamic_cast<const LightApp_DataOwner*>(theDataOwner);
+ SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>
+ (SUIT_Session::session()->activeApplication()->activeStudy());
+
+ if (owner && appStudy) {
+ _PTR(Study) study = appStudy->studyDS();
+ QString entry = owner->entry();
+
+ _PTR(SObject) obj (study->FindObjectID(entry.latin1())), aRefSO;
+ if( extractReference && obj && obj->ReferencedObject( aRefSO ) )
+ obj = aRefSO;
+ if (!obj) return false;