From 78dc4e5db3b8ec6af7f1ec9490fe806b2b7f0767 Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 27 Apr 2010 15:22:04 +0000 Subject: [PATCH] IPAL 21702: Fix problem with Animation restoring (patch Result entry if it is not valid) --- src/VISU_I/VISU_Result_i.cc | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) 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; } -- 2.39.2