]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Sorry, not so easy
authorapo <apo@opencascade.com>
Fri, 30 Nov 2007 07:42:20 +0000 (07:42 +0000)
committerapo <apo@opencascade.com>
Fri, 30 Nov 2007 07:42:20 +0000 (07:42 +0000)
src/VISU_I/VISU_ColoredPrs3d_i.cc

index dd973c563011f98428ffd336339c4cb437a4c557..0069fccac53940b71199551e9bbccb517477044e 100644 (file)
@@ -178,10 +178,11 @@ void
 VISU::ColoredPrs3d_i
 ::RemoveFromStudy()
 {
-  struct TRemoveFromStudy: public SALOME_Event
+  struct TEvent: public SALOME_Event
   {
     VISU::ColoredPrs3d_i* myRemovable;
-    TRemoveFromStudy(VISU::ColoredPrs3d_i* theRemovable):
+
+    TEvent(VISU::ColoredPrs3d_i* theRemovable):
       myRemovable(theRemovable)
     {}
     
@@ -190,13 +191,15 @@ VISU::ColoredPrs3d_i
     Execute()
     {
       SALOMEDS::SObject_var aSObject = myRemovable->GetSObject();
+
       if(!CORBA::is_nil(aSObject.in()))
        VISU::RemoveFromStudy(aSObject,false);
+
       myRemovable->TSuperClass::RemoveFromStudy();
     }
   };
 
-  ProcessVoidEvent(new TRemoveFromStudy(this));
+  ProcessVoidEvent(new TEvent(this));
 }
 
 
@@ -286,7 +289,8 @@ VISU::ColoredPrs3d_i
     if(!IsRangeFixed() && theReInit)
       SetSourceRange();
 
-    GetCResult()->ConnectObserver(this, myResultConnection);
+    if(GetPublishInStudyMode() != EDoNotPublish)
+      GetCResult()->ConnectObserver(this, myResultConnection);
 
     myPreviousEntity = myEntity;
     myPreviousFieldName = myFieldName;