Salome HOME
Fix for bug PAL12235 : Init values on input port not retrievable after write/read...
[modules/superv.git] / src / GraphBase / DataFlowBase_XmlHandler.cxx
index 2f22457f7e812892448165d5e962471775f17bd3..01fe6d9d7eac643480b10143b65fee52738fa07b 100644 (file)
@@ -48,6 +48,8 @@ GraphBase::XmlHandler::XmlHandler( CORBA::ORB_ptr Orb ,
   }
   VXSize = 0 ;
   GraphsNumber = 0 ;
+
+  aLinkValue = CORBA::Any();
 }
 
 GraphBase::XmlHandler::XmlHandler() {}
@@ -259,7 +261,12 @@ bool GraphBase::XmlHandler::endElement( const QString&,
             if ( constructor ) {
               int sizedata = aListOfDataFlows[ GraphsNumber ].Datas.size() ;
               aListOfDataFlows[ GraphsNumber ].Datas.resize( sizedata+1 ) ;                
-              aListOfDataFlows[ GraphsNumber ].Datas[ sizedata ] = aLink ;               
+
+             if ( aLink.aLinkValue.type()->kind() == CORBA::tk_double ) // mkr : PAL12235
+               aLink.aLinkValue = *aLinkDoubleValue ;
+
+             aListOfDataFlows[ GraphsNumber ].Datas[ sizedata ] = aLink ;               
+
               if ( VXSize ) {
                 aListOfDataFlows[ GraphsNumber ].Datas[ sizedata ].aListOfCoords.resize( VXSize ) ;
                 int ic ;
@@ -719,8 +726,9 @@ bool GraphBase::XmlHandler::endElement( const QString&,
               break;
            }
             case CORBA::tk_double: {
-              aLink.aLinkValue <<= (double ) 0. ;
-              double d;
+              //aLink.aLinkValue <<= (double ) 0. ;
+             double d = 0.;
+             aLink.aLinkValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
               aLink.aLinkValue >>= d;
 #if TRACE
               MESSAGE( d << " (double)" );
@@ -776,9 +784,12 @@ bool GraphBase::XmlHandler::endElement( const QString&,
               case CORBA::tk_double: {
                 double d;
                 sscanf( fieldvalue[depth].c_str() , "%lf" , &d ) ;
-                aLink.aLinkValue <<= d;
+                //aLink.aLinkValue <<= d;
+               aLink.aLinkValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+               aLinkValue.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+               aLinkDoubleValue = new CORBA::Any( aLinkValue );
 #if TRACE
-                MESSAGE( d << " (double)" );
+               MESSAGE( d << " (double)" );
 #endif
                 break;
              }