From a68a2d97675cb62fa3ab4cb99f6b983385518bb1 Mon Sep 17 00:00:00 2001 From: apo Date: Fri, 30 Nov 2007 07:42:20 +0000 Subject: [PATCH] Sorry, not so easy --- src/VISU_I/VISU_ColoredPrs3d_i.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/VISU_I/VISU_ColoredPrs3d_i.cc b/src/VISU_I/VISU_ColoredPrs3d_i.cc index dd973c56..0069fcca 100644 --- a/src/VISU_I/VISU_ColoredPrs3d_i.cc +++ b/src/VISU_I/VISU_ColoredPrs3d_i.cc @@ -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; -- 2.39.2