Salome HOME
Fix for the issue #2754 : the rename error message
authormpv <mpv@opencascade.com>
Wed, 30 Jan 2019 08:14:06 +0000 (11:14 +0300)
committermpv <mpv@opencascade.com>
Wed, 30 Jan 2019 08:14:06 +0000 (11:14 +0300)
src/XGUI/XGUI_Tools.cpp

index e058ff8cf112f202a6e9ed898fb2fc67dff0d9e6..e28c4ac4357d044b656ce1ff45a9fb90c0ffc3bb 100644 (file)
@@ -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