[SALOME platform 0019867]: Export/Import MED problem with Volumes

Prevent from whitespace being the last char of family name - II
This commit is contained in:
eap 2008-06-09 06:49:26 +00:00
parent 9400fe5867
commit bfc5148139

View File

@ -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<MED::eV2_1>();
else
maxSize = MED::GetNOMLength<MED::eV2_2>();
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){