X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_ImportImageOp.cxx;h=14c081255003be9a86e6ba8439faed75c4d14714;hb=0b4df27e9f347d6187dbf30bacf80b45c21813d4;hp=3d844bc1e70cd2a2632a13b295070090375a268e;hpb=bae0e2c1d1267ee4d445dff9f0f5b546e685bfd9;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_ImportImageOp.cxx b/src/HYDROGUI/HYDROGUI_ImportImageOp.cxx index 3d844bc1..14c08125 100644 --- a/src/HYDROGUI/HYDROGUI_ImportImageOp.cxx +++ b/src/HYDROGUI/HYDROGUI_ImportImageOp.cxx @@ -29,8 +29,6 @@ #include "HYDROGUI_Tool.h" #include "HYDROGUI_UpdateFlags.h" -#include - #include #include #include @@ -138,7 +136,7 @@ bool HYDROGUI_ImportImageOp::processApply( int& theUpdateFlags, if( !myIsEdit || ( !myEditedObject.IsNull() && myEditedObject->GetName() != anImageName ) ) { // check that there are no other objects with the same name in the document - Handle(HYDROData_Object) anObject = findObjectByName( anImageName, KIND_UNKNOWN ); + Handle(HYDROData_Object) anObject = HYDROGUI_Tool::FindObjectByName( module(), anImageName ); if( !anObject.IsNull() ) { theErrorMsg = tr( "OBJECT_EXISTS_IN_DOCUMENT" ).arg( anImageName ); @@ -257,18 +255,7 @@ void HYDROGUI_ImportImageOp::onCreatePreview( QImage theImage ) anImageName = myEditedObject->GetName(); } else - { - int anImageId = 1; - while( anImageId < 100 ) - { - anImageName = QString( "Image_%1" ).arg( QString::number( anImageId++ ) ); - - // check that there are no other objects with the same name in the document - Handle(HYDROData_Object) anObject = findObjectByName( anImageName, KIND_UNKNOWN ); - if( anObject.IsNull() ) - break; - } - } + anImageName = HYDROGUI_Tool::GenerateObjectName( module(), "Image" ); aPanel->setImageName( anImageName ); aPanel->initializePointSelection();