X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Fkernel%2FmarParameters.cpp;h=d2d5ae212cd7265a0a6be5b80e3f5f978c3a7518;hb=3d26e6f7bc33ab1a9955c35fa4d09311acbbff11;hp=1b582f7aed0d14d9e456fb31ba24307be1c8c9f5;hpb=e4ef2b5df5aac431ff3b806f83b7dd5e55e89d86;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/kernel/marParameters.cpp b/lib/maracasVisuLib/src/kernel/marParameters.cpp index 1b582f7..d2d5ae2 100644 --- a/lib/maracasVisuLib/src/kernel/marParameters.cpp +++ b/lib/maracasVisuLib/src/kernel/marParameters.cpp @@ -302,6 +302,7 @@ bool marParameters::load( std::ifstream& is ) int i, s; try { + char tmp[500]; is.read( ( char* )_boolValues, e_bool_cont * sizeof( bool ) ); is.read( ( char* )_intValues, e_int_cont * sizeof( int ) ); is.read( ( char* )_doubleValues, e_double_cont * sizeof( double ) ); @@ -309,7 +310,13 @@ bool marParameters::load( std::ifstream& is ) { is.read( ( char* )&s, sizeof( int ) ); _stringValues[ i ].resize( s ); +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 is.read( ( char* )_stringValues[ i ].c_str( ), s * sizeof( char ) ); +#else + is.read( tmp , s * sizeof( char ) ); + _stringValues[ i ]=wxString(tmp); +#endif } // rof return( true ); } @@ -328,8 +335,10 @@ bool marParameters::save( wxString& nw ) //EEDxx2.4 DEBuG // wxLogDebug("Saving parameters to file " + nw); - - if( os==NULL ) + +//EED2016-12-22 +// if( os==NULL ) + if( os.is_open()==false ) { wxString errorMsg; errorMsg= _T("Error : Cannot open file ")+nw+_T(" to save parameters"); @@ -360,7 +369,10 @@ bool marParameters::load( wxString& nr ) //EEDxx2.4 DEBuG // wxLogDebug("Laoding parameters from file " + nr); - if( is==NULL ) + +//EED 2016-12-22 +// if( is==NULL ) + if( is.is_open()==false ) { wxString errorMsg; errorMsg= _T("Error : Cannot open file ")+nr+_T(" to load parameters"); @@ -417,7 +429,12 @@ wxArrayString marParameters::getRelationalArray( ) for( i = 0; i < e_string_cont; i++, j += 2 ) { ret.Add( wxString( StringParamNames[ i ], wxConvUTF8) ); +//EED 2017-09-16 Migration wxWidgets 2.8 to 3.0 +#if wxMAJOR_VERSION <= 2 ret.Add( wxString( _stringValues[ i ].c_str( ), wxConvUTF8 ) ); +#else + ret.Add( wxString( _stringValues[ i ] ) ); +#endif } // rof