]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Bug IPAL17674 - 4.x, regression: SIGSEGV after trying to "Show" saved animation.
authorouv <ouv@opencascade.com>
Mon, 26 Nov 2007 12:20:38 +0000 (12:20 +0000)
committerouv <ouv@opencascade.com>
Mon, 26 Nov 2007 12:20:38 +0000 (12:20 +0000)
src/VISU_I/VISU_TimeAnimation.cxx

index 70946d1d2e0783af53d11cadcf264ac52de4e415..dcee2bc1595f6476aac52c226790eb1ab88decd0 100644 (file)
@@ -1750,7 +1750,7 @@ void VISU_TimeAnimation::saveAnimation()
   std::string aSComponentEntry = aSComponent->GetID();
 
   QString aComment;
-  aComment.sprintf("myComment=ANIMATION;myTimeMinVal=%g;myTimeMaxVal=%g;myMode=%d",
+  aComment.sprintf("myComment=ANIMATION;myTimeMinVal=%g;myTimeMaxVal=%g;mySequence=%s;myMode=%d",
                    myTimeMinVal,
                   myTimeMaxVal,
                   mySequence.latin1(),
@@ -1880,9 +1880,13 @@ void VISU_TimeAnimation::restoreFromStudy(_PTR(SObject) theField)
     VISU::Storable::TRestoringMap aPrsMap = VISU::Storable::GetStorableMap(aPrsObj);
     if (aPrsMap.empty())
       continue;
-    aData.myPrs[0]->Restore(VISU::GetSObject(aData.myField), aPrsMap);
-    aData.myPrs[0]->GetOffset(aData.myOffset);
+    if (aData.myPrs[0]) {
+      aData.myPrs[0]->Restore(VISU::GetSObject(aData.myField), aPrsMap);
+      aData.myPrs[0]->GetOffset(aData.myOffset);
+    }
     for (int i = 1; i < aData.myNbFrames; i++) {
+      if (!aData.myPrs[0])
+       continue;
       bool anIsFixedRange = false;
       if (aData.myPrsType != VISU::TGAUSSPOINTS) {
        if (VISU::ScalarMap_i* aPrs = dynamic_cast<VISU::ScalarMap_i*>(aData.myPrs[i]))
@@ -2164,7 +2168,7 @@ char* VISU_TimeAnimation_i::getAnimationSequence()
 
 CORBA::Boolean VISU_TimeAnimation_i::isSequenceDefined()
 {
-  return myAnim->isRangeDefined();
+  return myAnim->isSequenceDefined();
 }
 
 void VISU_TimeAnimation_i::dumpTo (const char* thePath)