From: eap Date: Mon, 9 Jun 2008 06:49:26 +0000 (+0000) Subject: [SALOME platform 0019867]: Export/Import MED problem with Volumes X-Git-Tag: V4_1_3~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=bfc51481397ed7b61ddfb5f98f96a9844883f652;p=modules%2Fsmesh.git [SALOME platform 0019867]: Export/Import MED problem with Volumes Prevent from whitespace being the last char of family name - II --- diff --git a/src/DriverMED/DriverMED_Family.cxx b/src/DriverMED/DriverMED_Family.cxx index 45aa1e30a..4b34b35d1 100644 --- a/src/DriverMED/DriverMED_Family.cxx +++ b/src/DriverMED/DriverMED_Family.cxx @@ -319,14 +319,15 @@ DriverMED_Family::GetFamilyInfo(const MED::PWrapper& theWrapper, aStr << "_" << *aGrIter; } string aValue = aStr.str(); - // PAL19785 - med forbids whitespace to be the last char in the name - MED::TInt maxSize; + // PAL19785,0019867 - med forbids whitespace to be the last char in the name + int maxSize; if ( theWrapper->GetVersion() == MED::eV2_1 ) maxSize = MED::GetNOMLength(); else maxSize = MED::GetNOMLength(); - if ( aValue.size() >= maxSize && aValue[ maxSize-1 ] == ' ' ) - aValue[ maxSize-1 ] = '_'; + int lastCharPos = min( maxSize, (int) aValue.size() ) - 1; + while ( isspace( aValue[ lastCharPos ] )) + aValue.resize( lastCharPos-- ); MED::PFamilyInfo anInfo; if(myId == 0 || myGroupAttributVal == 0){