52566]: TC7.5.0: Empty group of Balls at Diameter Equal to filter

trim trailing white spaces of names at publishing in study
This commit is contained in:
eap 2014-10-30 16:42:05 +03:00
parent bf19a06948
commit a0f09b9f1b
3 changed files with 14 additions and 8 deletions

View File

@ -463,9 +463,7 @@ void SMESHGUI_Add0DElemsOnAllNodesOp::onSelTypeChange(int selType)
//================================================================================ //================================================================================
/*! /*!
* \brief Install * \brief Install filters
*
*
*/ */
//================================================================================ //================================================================================

View File

@ -427,7 +427,7 @@ void SMESHGUI_SelectionOp::selected( QStringList& names,
{ {
_PTR(SObject) obj = _study->studyDS()->FindObjectID( anIt.Value()->getEntry() ); _PTR(SObject) obj = _study->studyDS()->FindObjectID( anIt.Value()->getEntry() );
if( obj ) if( obj )
names.append( obj->GetName().c_str() ); names.append( QString( obj->GetName().c_str() ).trimmed() );
} }
} }
} }

View File

@ -43,6 +43,8 @@
#include <TCollection_AsciiString.hxx> #include <TCollection_AsciiString.hxx>
#include <TopoDS_Solid.hxx> #include <TopoDS_Solid.hxx>
#include <cctype>
#ifdef _DEBUG_ #ifdef _DEBUG_
static int MYDEBUG = 0; static int MYDEBUG = 0;
//static int VARIABLE_DEBUG = 0; //static int VARIABLE_DEBUG = 0;
@ -341,9 +343,15 @@ void SMESH_Gen_i::SetName(SALOMEDS::SObject_ptr theSObject,
SALOMEDS::GenericAttribute_wrap anAttr = SALOMEDS::GenericAttribute_wrap anAttr =
aStudyBuilder->FindOrCreateAttribute( theSObject, "AttributeName" ); aStudyBuilder->FindOrCreateAttribute( theSObject, "AttributeName" );
SALOMEDS::AttributeName_wrap aNameAttr = anAttr; SALOMEDS::AttributeName_wrap aNameAttr = anAttr;
if ( theName && strlen( theName ) != 0 ) if ( theName && theName[0] ) {
aNameAttr->SetValue( theName ); std::string name( theName ); // trim trailing white spaces
else { for ( size_t i = name.size()-1; i > 0; --i )
if ( isspace( name[i] )) name[i] = '\0';
else break;
aNameAttr->SetValue( name.c_str() );
}
else
{
CORBA::String_var curName = aNameAttr->Value(); CORBA::String_var curName = aNameAttr->Value();
if ( strlen( curName.in() ) == 0 ) { if ( strlen( curName.in() ) == 0 ) {
SMESH_Comment aName(theDefaultName); SMESH_Comment aName(theDefaultName);