X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_Gen_i.cxx;h=6f413a322319afcbf6b479960b66be0a54faf2b5;hp=7d57ff91627cee4cfd92c22b0a7a1f9d54ce3a66;hb=9969477f2eb30b5f56ea1ed5ba8be2896b1a5fb2;hpb=9e1c526b0be009bc1eb72d6e0731fb234c6abefc diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index 7d57ff916..6f413a322 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -327,7 +327,9 @@ SMESH::SMESH_Hypothesis_ptr SMESH_Gen_i::createHypothesis(const char* theHypName { int libNameLen = strlen(theLibName); //check for old format "libXXXXXXX.so" - if( libNameLen > 7 && !strncmp( theLibName, "lib", 3 ) && !strcmp( theLibName+libNameLen-3, ".so" ) ) + if( libNameLen > 7 && + !strncmp( theLibName, "lib", 3 ) && + !strcmp( theLibName+libNameLen-3, ".so" ) ) { //the old format #ifdef WNT @@ -1705,8 +1707,12 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent, if( libname_len > 4 ) libname.resize( libname_len - 4 ); #else - if( libname_len > 3 ) - libname.resize( libname_len - 3 ); + // PAL17753 (Regresion: missing hypothesis in restored study) + // "lib" also should be removed from the beginning + //if( libname_len > 3 ) + //libname.resize( libname_len - 3 ); + if( libname_len > 6 ) + libname = libname.substr( 3, libname_len - 3 - 3 ); #endif CORBA::String_var objStr = GetORB()->object_to_string( anObject ); int id = myStudyContext->findId( string( objStr.in() ) ); @@ -1770,8 +1776,12 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent, if( libname_len > 4 ) libname.resize( libname_len - 4 ); #else - if( libname_len > 3 ) - libname.resize( libname_len - 3 ); + // PAL17753 (Regresion: missing hypothesis in restored study) + // "lib" also should be removed from the beginning + //if( libname_len > 3 ) + //libname.resize( libname_len - 3 ); + if( libname_len > 6 ) + libname = libname.substr( 3, libname_len - 3 - 3 ); #endif CORBA::String_var objStr = GetORB()->object_to_string( anObject ); int id = myStudyContext->findId( string( objStr.in() ) );