From 6426baa9f306e2eceed4e442a701773927038dc2 Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 19 Jul 2011 12:57:51 +0000 Subject: [PATCH] 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 --- src/SMESHGUI/SMESHGUI_DuplicateNodesDlg.cxx | 3 ++- src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx | 3 ++- src/SMESHGUI/SMESHGUI_GroupDlg.cxx | 1 - src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx | 2 ++ src/SMESHGUI/SMESHGUI_Utils.cxx | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI_DuplicateNodesDlg.cxx b/src/SMESHGUI/SMESHGUI_DuplicateNodesDlg.cxx index 36ba427de..f10ab17b0 100644 --- a/src/SMESHGUI/SMESHGUI_DuplicateNodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_DuplicateNodesDlg.cxx @@ -487,7 +487,8 @@ void SMESHGUI_DuplicateNodesDlg::onSelectionChanged() if ( myCurrentLineEdit == myLineEdit1 ) myGroups1 = aGroups; else if ( myCurrentLineEdit == myLineEdit2 ) myGroups2 = 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() ) ); } else { diff --git a/src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx b/src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx index 42d51513b..7e4fb9096 100644 --- a/src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx @@ -468,7 +468,8 @@ void SMESHGUI_FindElemByPointOp::onSelectionDone() if ( pObj && !myMeshOrPart->_is_nil() ) { 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(); SMESH::array_of_ElementType_var types = myMeshOrPart->GetTypes(); myDlg->setTypes( types ); diff --git a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx index d4d7647eb..d61b9397f 100644 --- a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx @@ -1612,7 +1612,6 @@ void SMESHGUI_GroupDlg::onSelectGeomGroup(bool on) } } - //================================================================================= // function : setCurrentSelection() // purpose : diff --git a/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx b/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx index 746cc5afd..624b32de9 100644 --- a/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx +++ b/src/SMESHGUI/SMESHGUI_Make2DFrom3DOp.cxx @@ -294,6 +294,8 @@ void SMESHGUI_Make2DFrom3DOp::selectionDone() QStringList names, ids; LightApp_Dialog::TypesList types; selected( names, types, ids ); + for ( int i = 0; i < names.count(); ++i ) + names[i] = names[i].trimmed(); myDlg->selectObject( names, types, ids ); // enable/desable "new mesh" button diff --git a/src/SMESHGUI/SMESHGUI_Utils.cxx b/src/SMESHGUI/SMESHGUI_Utils.cxx index 89d5d2d93..53e4bb38c 100644 --- a/src/SMESHGUI/SMESHGUI_Utils.cxx +++ b/src/SMESHGUI/SMESHGUI_Utils.cxx @@ -252,7 +252,7 @@ namespace SMESH int aNbSel = selected.Extent(); if (aNbSel == 1) { Handle(SALOME_InteractiveObject) anIObject = selected.First(); - theName = anIObject->getName(); + theName = QString( anIObject->getName() ).trimmed(); } else { theName = QObject::tr("SMESH_OBJECTS_SELECTED").arg(aNbSel); }