]> SALOME platform Git repositories - modules/superv.git/commitdiff
Salome HOME
Mandriva porting.
authormkr <mkr@opencascade.com>
Mon, 27 Feb 2006 15:42:15 +0000 (15:42 +0000)
committermkr <mkr@opencascade.com>
Mon, 27 Feb 2006 15:42:15 +0000 (15:42 +0000)
src/GraphBase/DataFlowBase_DataPort.cxx
src/GraphBase/DataFlowBase_XmlHandler.cxx

index 7eb22b1429e2eb48b75efcd76c1ee069ec165850..ca0d432894958ca4f1d03b04999e855cb002374b 100644 (file)
@@ -163,10 +163,11 @@ void GraphBase::DataPort::SetValue( const CORBA::Any * aDataValue ) {
 #endif
       }
       else if ( !strcmp( Type , "float" ) || !strcmp( Type , "double" ) ) {
-        double d ;
-        sscanf( t , "%lf" , &d ) ;
-        *theValue <<= d ;
-        *theValue >>= d;
+       double d ;
+       sscanf( t , "%lf" , &d ) ;
+       theValue->replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+        //*theValue <<= d ;
+        *theValue >>= d ;
 #if ValueTrace
         cdebug << " --> Value( " << d << ") (double) kind " << theValue->type()->kind() ;
 #endif
@@ -190,8 +191,12 @@ void GraphBase::DataPort::SetValue( const CORBA::Any * aDataValue ) {
                << theValue->type()->kind() ;
 #endif
       }
-      _theValue = theValue ;
-      *_Value = theValue ;
+      //_theValue = theValue ;
+      _theValue = new CORBA::Any( *theValue ) ;
+
+      //*_Value = theValue ;
+      _Value = &_theValue ;
+
 //JR 21.02.2005 Debug Memory leak : 
       delete aDataValue ;
     }
index 2f22457f7e812892448165d5e962471775f17bd3..73c39fd3f4ddeb721ffcc29fae4348a486919636 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 ( aLinkValue.type()->kind() == CORBA::tk_double )
+               aLink.aLinkValue = aLinkValue ;
+
+             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,11 @@ 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 = aLink.aLinkValue;
 #if TRACE
-                MESSAGE( d << " (double)" );
+               MESSAGE( d << " (double)" );
 #endif
                 break;
              }