From f26112a7812b4050237bf7f8a8e47c6f1c4eaced Mon Sep 17 00:00:00 2001 From: vsr Date: Mon, 22 Dec 2014 15:13:32 +0300 Subject: [PATCH] Fix bug for "light" modules: when running in "full" mode, Copy/Paste actions' state is not properly updated on selection change Another solution, to work properly withc opy-paste of multiple selection in "light" modules --- src/SalomeApp/SalomeApp_Application.cxx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index 3eaa957a8..b9cb79b08 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -688,11 +688,16 @@ void SalomeApp_Application::onSelectionChanged() LightApp_SelectionMgr* mgr = selectionMgr(); mgr->selectedObjects(list); - LightApp_Module* m = dynamic_cast( activeModule() ); - bool canCopy = false; bool canPaste = false; + LightApp_Module* m = dynamic_cast( activeModule() ); + + if ( m ) { + canCopy = m->canCopy(); + canPaste = m->canPaste(); + } + SalomeApp_Study* study = dynamic_cast(activeStudy()); if (study) { _PTR(Study) stdDS = study->studyDS(); @@ -704,12 +709,8 @@ void SalomeApp_Application::onSelectionChanged() _PTR(SObject) so = stdDS->FindObjectID(it.Value()->getEntry()); if ( so ) { - canCopy = studyMgr()->CanCopy(so); - canPaste = studyMgr()->CanPaste(so); - } - else if ( m ) { - canCopy = m->canCopy(); - canPaste = m->canPaste(); + canCopy = canCopy || studyMgr()->CanCopy(so); + canPaste = canPaste || studyMgr()->CanPaste(so); } } } -- 2.39.2