From: vsr Date: Tue, 27 Apr 2010 15:22:04 +0000 (+0000) Subject: IPAL 21702: Fix problem with Animation restoring (patch Result entry if it is not... X-Git-Tag: V5_1_4rc1~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=78dc4e5db3b8ec6af7f1ec9490fe806b2b7f0767;p=modules%2Fvisu.git IPAL 21702: Fix problem with Animation restoring (patch Result entry if it is not valid) --- diff --git a/src/VISU_I/VISU_Result_i.cc b/src/VISU_I/VISU_Result_i.cc index 1774c465..a0315f5c 100644 --- a/src/VISU_I/VISU_Result_i.cc +++ b/src/VISU_I/VISU_Result_i.cc @@ -102,12 +102,19 @@ namespace VISU GetResult(SALOMEDS::Study_ptr theStudy, const std::string& theResultEntry) { - if(CORBA::is_nil(theStudy)) - return NULL; - - SALOMEDS::SObject_var aSObject = theStudy->FindObjectID(theResultEntry.c_str()); - CORBA::Object_var anObject = SObjectToObject(aSObject); - return dynamic_cast(GetServant(anObject).in()); + Result_i* result = NULL; + if (!CORBA::is_nil(theStudy)) { + SALOMEDS::SComponent_var aSComponent = theStudy->FindComponent("VISU"); + if (!CORBA::is_nil(aSComponent)) { + std::string compid = aSComponent->GetID(); + std::string aResultEntry = theResultEntry; + if (theResultEntry.substr(0, compid.length()) != compid) aResultEntry = compid + theResultEntry.substr(compid.length()); + SALOMEDS::SObject_var aSObject = theStudy->FindObjectID(aResultEntry.c_str()); + CORBA::Object_var anObject = SObjectToObject(aSObject); + result = dynamic_cast(GetServant(anObject).in()); + } + } + return result; }