From: apo Date: Mon, 10 Oct 2005 05:53:04 +0000 (+0000) Subject: To improve CheckResult method X-Git-Tag: BR-D5-38-2003_D2005-12-10~25 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=46c37bbd9b3f2377147b678cf210809c280c1af6;p=modules%2Fvisu.git To improve CheckResult method --- diff --git a/src/VISUGUI/VisuGUI_Tools.cxx b/src/VISUGUI/VisuGUI_Tools.cxx index 85a6db88..6db5b293 100644 --- a/src/VISUGUI/VisuGUI_Tools.cxx +++ b/src/VISUGUI/VisuGUI_Tools.cxx @@ -521,6 +521,9 @@ namespace VISU _PTR(SObject) theSource, VISU::Result_var& theResult) { + if(theSource->Depth() < 3) // Bug of SALOMEDS : can\t get father from root object + return NULL; + _PTR(SObject) aSObj = theSource->GetFather(); if (!aSObj) return NULL; @@ -545,13 +548,7 @@ namespace VISU return NULL; theResult = VISU::Result::_narrow(anObject); - VISU::Result_i* pResult = dynamic_cast(VISU::GetServant(anObject).in()); - if (pResult == NULL) - SUIT_MessageBox::warn1(GetDesktop(theModule), - QObject::tr("WRN_VISU"), - QObject::tr("WRN_NO_AVAILABLE_DATA"), - QObject::tr("BUT_OK")); - return pResult; + return dynamic_cast(VISU::GetServant(anObject).in()); } //************************************************************