Salome HOME
23189: EDF 11603 - Dyssymetry in meshing
[modules/smesh.git] / src / StdMeshers_I / StdMeshers_NumberOfSegments_i.cxx
index 0033badf7f9364cfadd1e005c0bca7df3934e67a..4e6ef16ae844e39cdfa50caf380125251db7741b 100644 (file)
@@ -267,10 +267,13 @@ void StdMeshers_NumberOfSegments_i::SetDistrType(CORBA::Long typ)
 {
   ASSERT( myBaseImpl );
   try {
 {
   ASSERT( myBaseImpl );
   try {
+    CORBA::Long oldType = (CORBA::Long) this->GetImpl()->GetDistrType();
+
     this->GetImpl()->SetDistrType( (::StdMeshers_NumberOfSegments::DistrType) typ );
 
     // Update Python script
     this->GetImpl()->SetDistrType( (::StdMeshers_NumberOfSegments::DistrType) typ );
 
     // Update Python script
-    SMESH::TPythonDump() << _this() << ".SetDistrType( " << typ << " )";
+    if ( oldType != typ )
+      SMESH::TPythonDump() << _this() << ".SetDistrType( " << typ << " )";
   }
   catch ( SALOME_Exception& S_ex ) {
     THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
   }
   catch ( SALOME_Exception& S_ex ) {
     THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
@@ -397,7 +400,8 @@ void StdMeshers_NumberOfSegments_i::SetExpressionFunction(const char* expr)
     SMESH::TPythonDump() << _this() << ".SetExpressionFunction( '" << expr << "' )";
   }
   catch ( SALOME_Exception& S_ex ) {
     SMESH::TPythonDump() << _this() << ".SetExpressionFunction( '" << expr << "' )";
   }
   catch ( SALOME_Exception& S_ex ) {
-    THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM );
+    THROW_SALOME_CORBA_EXCEPTION( S_ex.what(),
+                                  SALOME::BAD_PARAM );
   }
 }
 
   }
 }