From: mkr Date: Fri, 3 Feb 2006 07:38:45 +0000 (+0000) Subject: Fix for PAL8004 : CRASH after trying to run edited MacroNode execution. X-Git-Tag: mergeto_trunk_07Feb06~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0e70290e00122fa38453c01885466e5af84c4380;p=modules%2Fsuperv.git Fix for PAL8004 : CRASH after trying to run edited MacroNode execution. --- diff --git a/src/GraphEditor/DataFlowEditor_OutNode.cxx b/src/GraphEditor/DataFlowEditor_OutNode.cxx index 5221b4f..52d6601 100644 --- a/src/GraphEditor/DataFlowEditor_OutNode.cxx +++ b/src/GraphEditor/DataFlowEditor_OutNode.cxx @@ -36,14 +36,11 @@ using namespace std; map< string , int > _MapOfGraphNames; string GraphInstanceName( const char * aGraphName ) { + // mkr : PAL8004 --> + // For Macro nodes : names of subgraphs must be unique and differ from the main dataflow + // name (i.e. the dataflow with MacroLevel = 0). + // It is neccessary for reqursive call of LoadDataFlows(...) method for MacroNodes execution. int GraphInstanceNumber = _MapOfGraphNames[ aGraphName ] ; - if ( GraphInstanceNumber ) { - _MapOfGraphNames[ aGraphName ] = GraphInstanceNumber + 1 ; - } - else { - GraphInstanceNumber = 0 ; - _MapOfGraphNames[ aGraphName ] = GraphInstanceNumber + 1 ; - } string theGraphInstanceName = string( aGraphName ) ; if ( GraphInstanceNumber ) { theGraphInstanceName += "_" ; @@ -51,6 +48,10 @@ string GraphInstanceName( const char * aGraphName ) { astr << GraphInstanceNumber ; theGraphInstanceName += astr.str() ; } + if ( theGraphInstanceName != string( aGraphName ) ) + _MapOfGraphNames[ theGraphInstanceName ] = GraphInstanceNumber ; + _MapOfGraphNames[ aGraphName ] = GraphInstanceNumber + 1 ; + // mkr : PAL8004 <-- return theGraphInstanceName ; }