Salome HOME
Fix for bug PAL7960: Editing() only after SUCCESSFUL port creation.
authorasv <asv@opencascade.com>
Mon, 7 Feb 2005 06:34:59 +0000 (06:34 +0000)
committerasv <asv@opencascade.com>
Mon, 7 Feb 2005 06:34:59 +0000 (06:34 +0000)
src/SUPERVGUI/SUPERVGUI_Clipboard.cxx

index 4f20f9fab121634598a34860ddb48da8a0a41822..a9d4637a35b841aa61421204c22b14e980f83fd1 100644 (file)
@@ -367,8 +367,6 @@ void SUPERVGUI_Clipboard::pastePort( SUPERVGUI_CanvasNode* node )
   SUPERVGUI_Main* aMain = Supervision.getMain();
   if ( !CORBA::is_nil(aPort) && aMain ) {
 
-    aMain->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag, why here? -> PAL7960
-
     SUPERV::INode_var aNode = node->getInlineNode();
     if (!CORBA::is_nil(aNode)) {
       QString aName = aPort->Name();
@@ -379,16 +377,20 @@ void SUPERVGUI_Clipboard::pastePort( SUPERVGUI_CanvasNode* node )
        QStringList aNames = node->getPortsNamesIN(aNode, true);
        if (aNames.contains(aName))
          QMessageBox::warning( QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_PORT_EXIST") );
-       else
+       else {
+         aMain->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag, why here? -> PAL7960
          aPastePort = aNode->InPort(aName.latin1(), aType.latin1());
+       }
       }
       else {
        //check if port with such name is already exists
        QStringList aNames = node->getPortsNamesIN(aNode, false);
        if (aNames.contains(aName))
          QMessageBox::warning( QAD_Application::getDesktop(), tr("ERROR"), tr("MSG_PORT_EXIST") );
-       else
+       else {
+         aMain->Editing(); // PAL6170: GUI->Engine: setting "Editing" flag, why here? -> PAL7960
          aPastePort = aNode->OutPort(aName.latin1(), aType.latin1());
+       }
       }
       if ( !CORBA::is_nil(aPastePort) )
        node->createPort( aPastePort.in() );