]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Fix bug for "light" modules: when running in "full" mode, Copy/Paste actions' state...
authorvsr <vsr@opencascade.com>
Mon, 22 Dec 2014 12:13:32 +0000 (15:13 +0300)
committervsr <vsr@opencascade.com>
Mon, 22 Dec 2014 12:13:32 +0000 (15:13 +0300)
Another solution, to work properly withc opy-paste of multiple selection in "light" modules

src/SalomeApp/SalomeApp_Application.cxx

index 3eaa957a866a111d5898ac096358f9e641bff798..b9cb79b08160438ce81400b8d34022e7ddfe619a 100644 (file)
@@ -688,11 +688,16 @@ void SalomeApp_Application::onSelectionChanged()
    LightApp_SelectionMgr* mgr = selectionMgr();
    mgr->selectedObjects(list);
 
-   LightApp_Module* m = dynamic_cast<LightApp_Module*>( activeModule() );
-
    bool canCopy  = false;
    bool canPaste = false;
 
+   LightApp_Module* m = dynamic_cast<LightApp_Module*>( activeModule() );
+
+   if ( m ) {
+     canCopy  = m->canCopy();
+     canPaste = m->canPaste();
+   }
+
    SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>(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);
          }
        }
      }