From 380f74020579c3c30f7e281f7945af34c6c37c67 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 13 Apr 2006 14:43:23 +0000 Subject: [PATCH] restore scale factor removed by mistake --- src/SMESH_I/SMESH_2smeshpy.cxx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/SMESH_I/SMESH_2smeshpy.cxx b/src/SMESH_I/SMESH_2smeshpy.cxx index f8941eb16..714ae7a4c 100644 --- a/src/SMESH_I/SMESH_2smeshpy.cxx +++ b/src/SMESH_I/SMESH_2smeshpy.cxx @@ -934,13 +934,16 @@ bool _pyNumberOfSegmentsHyp::Addition2Creation( const Handle(_pyCommand)& theCmd const _pyID& theMesh) { if ( IsWrappable( theMesh ) && myArgs.Length() > 1 ) { - // scale factor (2-nd arg) is provided: clear SetDistrType(1) - list::iterator cmd = myUnknownCommands.begin(); - for ( ; cmd != myUnknownCommands.end(); ++cmd ) { + // scale factor (2-nd arg) is provided: clear SetDistrType(1) command + bool scaleDistrType = false; + list::reverse_iterator cmd = myUnknownCommands.rbegin(); + for ( ; cmd != myUnknownCommands.rend(); ++cmd ) { if ( (*cmd)->GetMethod() == "SetDistrType" ) { - if ( (*cmd)->GetArg( 1 ) == "1" ) + if ( (*cmd)->GetArg( 1 ) == "1" ) { + scaleDistrType = true; (*cmd)->Clear(); - else { + } + else if ( !scaleDistrType ) { // distribution type changed: remove scale factor from args myArgs.Remove( 2, myArgs.Length() ); break; -- 2.39.2