From: abd Date: Mon, 31 Jul 2006 11:19:41 +0000 (+0000) Subject: BUG SWP13062 X-Git-Tag: LAST_STABLE_VERSION_21_09_2006_ON_3_2_0~7 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=662ae2fe78711182d4d2846be738caf4a7e3aab6;p=modules%2Fsmesh.git BUG SWP13062 Adding crossplatform saving of libname for Algorithms and Hypothesises --- diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index 185e2fc68..142a90895 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -1299,7 +1299,18 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent, SMESH_Hypothesis_i* myImpl = dynamic_cast( GetServant( myHyp ).in() ); if ( myImpl ) { string hypname = string( myHyp->GetName() ); - string libname = string( myHyp->GetLibName() ); + string libname = string( myHyp->GetLibName() ); +// BUG SWP13062 +// Needs for save crossplatform libname, i.e. parth of name ( ".dll" for +// WNT and ".so" for X-system) must be deleted + int libname_len = libname.length(); +#ifdef WNT + if( libname_len > 4 ) + libname.resize( libname_len - 4 ); +#else + if( libname_len > 3 ) + libname.resize( libname_len - 3 ); +#endif CORBA::String_var objStr = GetORB()->object_to_string( anObject ); int id = myStudyContext->findId( string( objStr.in() ) ); string hypdata = string( myImpl->SaveTo() ); @@ -1354,6 +1365,17 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent, if ( myImpl ) { string hypname = string( myHyp->GetName() ); string libname = string( myHyp->GetLibName() ); +// BUG SWP13062 +// Needs for save crossplatform libname, i.e. parth of name ( ".dll" for +// WNT and ".so" for X-system) must be deleted + int libname_len = libname.length(); +#ifdef WNT + if( libname_len > 4 ) + libname.resize( libname_len - 4 ); +#else + if( libname_len > 3 ) + libname.resize( libname_len - 3 ); +#endif CORBA::String_var objStr = GetORB()->object_to_string( anObject ); int id = myStudyContext->findId( string( objStr.in() ) ); string hypdata = string( myImpl->SaveTo() );