From 168c7f9a64a2c2a02dc47947b3e758e6e47b0af3 Mon Sep 17 00:00:00 2001 From: mkr Date: Mon, 27 Feb 2006 15:42:15 +0000 Subject: [PATCH] Mandriva porting. --- src/GraphBase/DataFlowBase_DataPort.cxx | 17 +++++++++++------ src/GraphBase/DataFlowBase_XmlHandler.cxx | 20 +++++++++++++++----- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/GraphBase/DataFlowBase_DataPort.cxx b/src/GraphBase/DataFlowBase_DataPort.cxx index 7eb22b1..ca0d432 100644 --- a/src/GraphBase/DataFlowBase_DataPort.cxx +++ b/src/GraphBase/DataFlowBase_DataPort.cxx @@ -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 ; } diff --git a/src/GraphBase/DataFlowBase_XmlHandler.cxx b/src/GraphBase/DataFlowBase_XmlHandler.cxx index 2f22457..73c39fd 100644 --- a/src/GraphBase/DataFlowBase_XmlHandler.cxx +++ b/src/GraphBase/DataFlowBase_XmlHandler.cxx @@ -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; } -- 2.39.2