Salome HOME
52566]: TC7.5.0: Empty group of Balls at Diameter Equal to filter
authoreap <eap@opencascade.com>
Thu, 30 Oct 2014 13:42:05 +0000 (16:42 +0300)
committereap <eap@opencascade.com>
Thu, 30 Oct 2014 13:42:05 +0000 (16:42 +0300)
 trim trailing white spaces of names at publishing in study

src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.cxx
src/SMESHGUI/SMESHGUI_SelectionOp.cxx
src/SMESH_I/SMESH_Gen_i_1.cxx

index 9cbad861c453b08361e8a96bc38836bd8742ff6c..b053c60998ec2d5b549fb32633f3b75cb5b23029 100644 (file)
@@ -463,9 +463,7 @@ void SMESHGUI_Add0DElemsOnAllNodesOp::onSelTypeChange(int selType)
 
 //================================================================================
 /*!
 
 //================================================================================
 /*!
- * \brief Install 
- * 
- * 
+ * \brief Install filters
  */
 //================================================================================
 
  */
 //================================================================================
 
index 999951ba30e4408a69633f151887dfde9857097f..daf2bf493ff5e4a499d2e05130a58e42b61b6543 100644 (file)
@@ -427,7 +427,7 @@ void SMESHGUI_SelectionOp::selected( QStringList& names,
       {
         _PTR(SObject) obj = _study->studyDS()->FindObjectID( anIt.Value()->getEntry() );
         if( obj )
       {
         _PTR(SObject) obj = _study->studyDS()->FindObjectID( anIt.Value()->getEntry() );
         if( obj )
-          names.append( obj->GetName().c_str() );
+          names.append( QString( obj->GetName().c_str() ).trimmed() );
       }
     }
   }
       }
     }
   }
index 6890bcf08e1f9867328a4ba193256c9305b2a519..b59479fce561d0c5a843b181968fc5604a4b7b76 100644 (file)
@@ -43,6 +43,8 @@
 #include <TCollection_AsciiString.hxx>
 #include <TopoDS_Solid.hxx>
 
 #include <TCollection_AsciiString.hxx>
 #include <TopoDS_Solid.hxx>
 
+#include <cctype>
+
 #ifdef _DEBUG_
 static int MYDEBUG = 0;
 //static int VARIABLE_DEBUG = 0;
 #ifdef _DEBUG_
 static int MYDEBUG = 0;
 //static int VARIABLE_DEBUG = 0;
@@ -341,9 +343,15 @@ void SMESH_Gen_i::SetName(SALOMEDS::SObject_ptr theSObject,
     SALOMEDS::GenericAttribute_wrap   anAttr =
       aStudyBuilder->FindOrCreateAttribute( theSObject, "AttributeName" );
     SALOMEDS::AttributeName_wrap aNameAttr = anAttr;
     SALOMEDS::GenericAttribute_wrap   anAttr =
       aStudyBuilder->FindOrCreateAttribute( theSObject, "AttributeName" );
     SALOMEDS::AttributeName_wrap aNameAttr = anAttr;
-    if ( theName && strlen( theName ) != 0 )
-      aNameAttr->SetValue( theName );
-    else {
+    if ( theName && theName[0] ) {
+      std::string name( theName ); // trim trailing white spaces
+      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();
       if ( strlen( curName.in() ) == 0 ) {
         SMESH_Comment aName(theDefaultName);
       CORBA::String_var curName = aNameAttr->Value();
       if ( strlen( curName.in() ) == 0 ) {
         SMESH_Comment aName(theDefaultName);
@@ -355,7 +363,7 @@ void SMESH_Gen_i::SetName(SALOMEDS::SObject_ptr theSObject,
 
 //=======================================================================
 //function : SetPixMap
 
 //=======================================================================
 //function : SetPixMap
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 void SMESH_Gen_i::SetPixMap(SALOMEDS::SObject_ptr theSObject,
 //=======================================================================
 
 void SMESH_Gen_i::SetPixMap(SALOMEDS::SObject_ptr theSObject,