From f3a79bbb5aa60a5d1866e2e6707071244e3029f9 Mon Sep 17 00:00:00 2001 From: vsv Date: Wed, 11 Nov 2015 14:26:48 +0300 Subject: [PATCH] Issue #1075: Disable Delete command on sub-feature object --- src/ModuleBase/ModuleBase_Tools.cpp | 8 ++++---- src/XGUI/XGUI_ContextMenuMgr.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ModuleBase/ModuleBase_Tools.cpp b/src/ModuleBase/ModuleBase_Tools.cpp index 5d3643ab7..889da3e0e 100755 --- a/src/ModuleBase/ModuleBase_Tools.cpp +++ b/src/ModuleBase/ModuleBase_Tools.cpp @@ -245,11 +245,11 @@ void checkObjects(const QObjectPtrList& theObjects, bool& hasResult, bool& hasFe ResultPtr aResult = std::dynamic_pointer_cast(aObj); ResultParameterPtr aConstruction = std::dynamic_pointer_cast(aResult); - hasResult = (aResult.get() != NULL); - hasFeature = (aFeature.get() != NULL); - hasParameter = (aConstruction.get() != NULL); + hasResult |= (aResult.get() != NULL); + hasFeature |= (aFeature.get() != NULL); + hasParameter |= (aConstruction.get() != NULL); if (hasFeature) - hasSubFeature = (ModelAPI_Tools::compositeOwner(aFeature) != NULL); + hasSubFeature |= (ModelAPI_Tools::compositeOwner(aFeature) != NULL); if (hasFeature && hasResult && hasParameter && hasSubFeature) break; } diff --git a/src/XGUI/XGUI_ContextMenuMgr.cpp b/src/XGUI/XGUI_ContextMenuMgr.cpp index 7b570f9cc..7c40774dd 100644 --- a/src/XGUI/XGUI_ContextMenuMgr.cpp +++ b/src/XGUI/XGUI_ContextMenuMgr.cpp @@ -218,7 +218,7 @@ void XGUI_ContextMenuMgr::updateObjectBrowserMenu() if( aMgr->activeDocument() == aObject->document() ) { action("RENAME_CMD")->setEnabled(true); - action("DELETE_CMD")->setEnabled(true); + action("DELETE_CMD")->setEnabled(!hasSubFeature); } } } else { -- 2.39.2