Salome HOME
RemoveOutPort with optionnal remove of the InPort in that OutPort
[modules/superv.git] / src / GraphBase / DataFlowBase_OutPort.cxx
index d03f937aa6eb42ac52f5600151d2084db1d39b18..0aa449950628f8f33cfe5ba06dbc52b3a30dbb3e 100644 (file)
@@ -113,7 +113,9 @@ bool GraphBase::OutPort::RemoveInPort() {
       Kind( SUPERV::InLineParameter ) ;
     }
   }
-  toPort->RemoveOutPort() ;
+  if ( toPort->GetOutPort() ) {
+    toPort->RemoveOutPort( false ) ;
+  }
   cdebug << "OutPort::RemoveInPort " << NodeName() << "( " << PortName() << " " << PortStatus()
          << " " << Kind() << " ) _InPortsSize " << _InPortsSize << " --> "
          << toPort->NodeName() << "( " << toPort->PortName() << " " << toPort->PortStatus()
@@ -146,7 +148,9 @@ bool GraphBase::OutPort::RemoveInPort( GraphBase::InPort * toPort ) {
       Kind( SUPERV::InLineParameter ) ;
     }
   }
-  toPort->RemoveOutPort() ;
+  if ( toPort->GetOutPort() ) {
+    toPort->RemoveOutPort( false ) ;
+  }
   return true ;
 }
 
@@ -154,7 +158,7 @@ bool GraphBase::OutPort::ReNameInPort( const char* OldNodePortName ,
                                        const char* NewNodePortName ) {
   int index = _MapOfInPorts[ OldNodePortName ] ;
   if ( index <= 0 || index > _InPortsSize ) {
-    cdebug << "GraphBase::OutPort::ReNameInPort Error " << OldNodePortName
+    cdebug << "GraphBase::OutPort::ReNameInPort Error in Node " << NodeName() << " " << OldNodePortName
            << " --> " << NewNodePortName << " index " << index << endl ;
     return false ;
   }