X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_ChannelOp.cxx;h=f00d5804c1d847b70661f8ba8f19570b55bd2550;hb=d6e19029f8b41f295db878e9aecf451c2edda4af;hp=d3acb739e14bff037b69c9c7c6888d61821c6283;hpb=439579ec24edd8b147cab07f688d446d59029a1e;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_ChannelOp.cxx b/src/HYDROGUI/HYDROGUI_ChannelOp.cxx index d3acb739..f00d5804 100644 --- a/src/HYDROGUI/HYDROGUI_ChannelOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ChannelOp.cxx @@ -181,19 +181,33 @@ bool HYDROGUI_ChannelOp::processApply( int& theUpdateFlags, QString aGuideLineName = aPanel->getGuideLineName(); QString aProfileName = aPanel->getProfileName(); - if ( aGuideLineName.isEmpty() || aProfileName.isEmpty() ) + /*if ( aGuideLineName.isEmpty() || aProfileName.isEmpty() ) { myEditedObject->RemoveGuideLine(); myEditedObject->RemoveProfile(); } - else + else*/ { Handle(HYDROData_Polyline3D) aGuideLine = Handle(HYDROData_Polyline3D)::DownCast( HYDROGUI_Tool::FindObjectByName( module(), aGuideLineName, KIND_POLYLINE ) ); + if ( aGuideLine.IsNull() ) + { + theErrorMsg = tr( "GUIDE_LINE_IS_NOT_SELECTED" ); + return false; + } + + myEditedObject->RemoveGuideLine(); myEditedObject->SetGuideLine( aGuideLine ); Handle(HYDROData_Profile) aProfile = Handle(HYDROData_Profile)::DownCast( HYDROGUI_Tool::FindObjectByName( module(), aProfileName, KIND_PROFILE ) ); + if ( aProfile.IsNull() ) + { + theErrorMsg = tr( "PROFILE_IS_NOT_SELECTED" ); + return false; + } + + myEditedObject->RemoveProfile(); myEditedObject->SetProfile( aProfile ); }