From: dmv Date: Thu, 15 Oct 2009 10:47:52 +0000 (+0000) Subject: IPAL21387 Unknown Exception after OK in Quadrangle Parameters Hypothesis dialog box. X-Git-Tag: RELIQUAT_5x_30102009~20 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f21bad41556139f9a2ce2f4ecba5da10459f5b82;p=modules%2Fsmesh.git IPAL21387 Unknown Exception after OK in Quadrangle Parameters Hypothesis dialog box. --- diff --git a/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx b/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx index 690507e21..cce36edb0 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx @@ -384,6 +384,12 @@ bool StdMeshersGUI_StdHypothesisCreator::checkParams( QString& msg ) const widget< StdMeshersGUI_LayerDistributionParamWdg >( 0 ); ok = ( w && w->IsOk() ); } + else if ( hypType() == "QuadrangleParams" ) + { + StdMeshersGUI_SubShapeSelectorWdg* w = + widget< StdMeshersGUI_SubShapeSelectorWdg >( 0 ); + ok = ( w->GetListSize() > 0 ); + } return ok; } @@ -604,11 +610,11 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const StdMeshersGUI_SubShapeSelectorWdg* w = widget< StdMeshersGUI_SubShapeSelectorWdg >( 0 ); if (w) { - if( int id = w->GetListOfIDs()[0] ) { - h->SetTriaVertex( id ); + if( w->GetListSize() > 0 ) { + h->SetTriaVertex( w->GetListOfIDs()[0] ); // getlist must be called once + const char * entry = w->GetMainShapeEntry(); + h->SetObjectEntry( entry ); } - const char * entry = w->GetMainShapeEntry(); - h->SetObjectEntry( entry ); } } } diff --git a/src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.h b/src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.h index 48f4bc8ce..49e49e82a 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.h +++ b/src/StdMeshersGUI/StdMeshersGUI_SubShapeSelectorWdg.h @@ -77,6 +77,8 @@ public: void showPreview ( bool ); + int GetListSize() { return myListOfIDs.size(); } + void SetMaxSize(int aMaxSize) { myMaxSize = aMaxSize; } void SetSubShType(TopAbs_ShapeEnum aSubShType) { mySubShType = aSubShType; }