}
// check that there are no other objects with the same name in the document
- Handle(HYDROData_Object) anObject = HYDROGUI_Tool::FindObjectByName( module(), anObjectName );
- if ( !anObject.IsNull() )
+ if( !myIsEdit || ( !myEditedObject.IsNull() && myEditedObject->GetName() != anObjectName ) )
{
- theErrorMsg = tr( "OBJECT_EXISTS_IN_DOCUMENT" ).arg( anObjectName );
- return false;
+ Handle(HYDROData_Object) anObject = HYDROGUI_Tool::FindObjectByName( module(), anObjectName );
+ if ( !anObject.IsNull() )
+ {
+ theErrorMsg = tr( "OBJECT_EXISTS_IN_DOCUMENT" ).arg( anObjectName );
+ return false;
+ }
}
Handle(HYDROData_Calculation) aCalculObj = myIsEdit ? myEditedObject :