0021327: EDF 1915 SMESH: impossible to select a group to copy mesh

trim white spaces at end of object name, else the object seems not selected
This commit is contained in:
eap 2011-07-19 12:57:51 +00:00
parent 39f36db219
commit 6426baa9f3
5 changed files with 7 additions and 4 deletions

View File

@ -487,7 +487,8 @@ void SMESHGUI_DuplicateNodesDlg::onSelectionChanged()
if ( myCurrentLineEdit == myLineEdit1 ) myGroups1 = aGroups; if ( myCurrentLineEdit == myLineEdit1 ) myGroups1 = aGroups;
else if ( myCurrentLineEdit == myLineEdit2 ) myGroups2 = aGroups; else if ( myCurrentLineEdit == myLineEdit2 ) myGroups2 = aGroups;
else if ( myCurrentLineEdit == myLineEdit3 ) myGroups3 = aGroups; else if ( myCurrentLineEdit == myLineEdit3 ) myGroups3 = aGroups;
myCurrentLineEdit->setText( aGroups.count() == 1 ? aGroups[0]->GetName() : CORBA::String_var name = aGroups[0]->GetName();
myCurrentLineEdit->setText( aGroups.count() == 1 ? QString(name).trimmed() :
QObject::tr( "SMESH_OBJECTS_SELECTED" ).arg( aGroups.count() ) ); QObject::tr( "SMESH_OBJECTS_SELECTED" ).arg( aGroups.count() ) );
} }
else { else {

View File

@ -468,7 +468,8 @@ void SMESHGUI_FindElemByPointOp::onSelectionDone()
if ( pObj && !myMeshOrPart->_is_nil() ) if ( pObj && !myMeshOrPart->_is_nil() )
{ {
myMeshIO = anIO; myMeshIO = anIO;
myDlg->myMeshName->setText( pObj->GetName().c_str() ); std::string name = pObj->GetName();
myDlg->myMeshName->setText( QString( name.c_str() ).trimmed() );
newMeshEntry = anIO->getEntry(); newMeshEntry = anIO->getEntry();
SMESH::array_of_ElementType_var types = myMeshOrPart->GetTypes(); SMESH::array_of_ElementType_var types = myMeshOrPart->GetTypes();
myDlg->setTypes( types ); myDlg->setTypes( types );

View File

@ -1612,7 +1612,6 @@ void SMESHGUI_GroupDlg::onSelectGeomGroup(bool on)
} }
} }
//================================================================================= //=================================================================================
// function : setCurrentSelection() // function : setCurrentSelection()
// purpose : // purpose :

View File

@ -294,6 +294,8 @@ void SMESHGUI_Make2DFrom3DOp::selectionDone()
QStringList names, ids; QStringList names, ids;
LightApp_Dialog::TypesList types; LightApp_Dialog::TypesList types;
selected( names, types, ids ); selected( names, types, ids );
for ( int i = 0; i < names.count(); ++i )
names[i] = names[i].trimmed();
myDlg->selectObject( names, types, ids ); myDlg->selectObject( names, types, ids );
// enable/desable "new mesh" button // enable/desable "new mesh" button

View File

@ -252,7 +252,7 @@ namespace SMESH
int aNbSel = selected.Extent(); int aNbSel = selected.Extent();
if (aNbSel == 1) { if (aNbSel == 1) {
Handle(SALOME_InteractiveObject) anIObject = selected.First(); Handle(SALOME_InteractiveObject) anIObject = selected.First();
theName = anIObject->getName(); theName = QString( anIObject->getName() ).trimmed();
} else { } else {
theName = QObject::tr("SMESH_OBJECTS_SELECTED").arg(aNbSel); theName = QObject::tr("SMESH_OBJECTS_SELECTED").arg(aNbSel);
} }