From: mpv Date: Wed, 30 Jan 2019 08:14:06 +0000 (+0300) Subject: Fix for the issue #2754 : the rename error message X-Git-Tag: Jan2019~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=67f0c1647f8e09955fb4b886b26891f42aa7f5c6;p=modules%2Fshaper.git Fix for the issue #2754 : the rename error message --- diff --git a/src/XGUI/XGUI_Tools.cpp b/src/XGUI/XGUI_Tools.cpp index e058ff8cf..e28c4ac43 100644 --- a/src/XGUI/XGUI_Tools.cpp +++ b/src/XGUI/XGUI_Tools.cpp @@ -171,8 +171,8 @@ bool canRename(const ObjectPtr& theObject, const QString& theName) ObjectPtr aObj = aDoc->objectByName(aType, theName.toStdString()); - if (aObj.get()) { - QString aErrMsg(QObject::tr("%1 with name %2 already exists."). + if (aObj.get() && theObject != aObj) { + QString aErrMsg(QObject::tr("Name %2 already exists in %1."). arg(aType.c_str()).arg(theName)); // We can not use here a dialog box for message - // it will crash editing process in ObjectBrowser