From bfc51481397ed7b61ddfb5f98f96a9844883f652 Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 9 Jun 2008 06:49:26 +0000 Subject: [PATCH] [SALOME platform 0019867]: Export/Import MED problem with Volumes Prevent from whitespace being the last char of family name - II --- src/DriverMED/DriverMED_Family.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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){ -- 2.39.2