From 46c37bbd9b3f2377147b678cf210809c280c1af6 Mon Sep 17 00:00:00 2001 From: apo Date: Mon, 10 Oct 2005 05:53:04 +0000 Subject: [PATCH] To improve CheckResult method --- src/VISUGUI/VisuGUI_Tools.cxx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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()); } //************************************************************ -- 2.39.2