]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
IPAL 21702: Fix problem with Animation restoring (patch Result entry if it is not...
authorvsr <vsr@opencascade.com>
Tue, 27 Apr 2010 15:22:04 +0000 (15:22 +0000)
committervsr <vsr@opencascade.com>
Tue, 27 Apr 2010 15:22:04 +0000 (15:22 +0000)
src/VISU_I/VISU_Result_i.cc

index 1774c465241a32b623a487f22c87564ebab32474..a0315f5ccc663d48a077daffafa4bb3d6d617b78 100644 (file)
@@ -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<VISU::Result_i*>(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<VISU::Result_i*>(GetServant(anObject).in());
+      }
+    }
+    return result;
   }