From: adv Date: Fri, 6 Dec 2013 12:02:04 +0000 (+0000) Subject: Rename of bathymetry object corrected (Bug #165). X-Git-Tag: BR_hydro_v_0_4~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8a7c7e5abd642e3ccf6f315eb1d745884a39d5c3;p=modules%2Fhydro.git Rename of bathymetry object corrected (Bug #165). --- diff --git a/src/HYDROGUI/HYDROGUI_ImportBathymetryOp.cxx b/src/HYDROGUI/HYDROGUI_ImportBathymetryOp.cxx index ea5eb1e1..458e2e80 100644 --- a/src/HYDROGUI/HYDROGUI_ImportBathymetryOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportBathymetryOp.cxx @@ -121,12 +121,15 @@ bool HYDROGUI_ImportBathymetryOp::processApply( int& theUpdateFlags, return false; } - // check that there are no other objects with the same name in the document - Handle(HYDROData_Entity) anObject = HYDROGUI_Tool::FindObjectByName( module(), anObjectName ); - if ( ( !myIsEdit ) && ( !anObject.IsNull() ) ) + if( !myIsEdit || ( !myEditedObject.IsNull() && myEditedObject->GetName() != anObjectName ) ) { - theErrorMsg = tr( "OBJECT_EXISTS_IN_DOCUMENT" ).arg( anObjectName ); - return false; + // check that there are no other objects with the same name in the document + Handle(HYDROData_Entity) anObject = HYDROGUI_Tool::FindObjectByName( module(), anObjectName ); + if( !anObject.IsNull() ) + { + theErrorMsg = tr( "OBJECT_EXISTS_IN_DOCUMENT" ).arg( anObjectName ); + return false; + } } Handle(HYDROData_Bathymetry) aBathymetryObj;