X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH_I%2FSMESH_2smeshpy.cxx;h=929da0dcf43bc2518b5e946ff3dd1d90e88374f8;hb=a08c213e66fe27f9073b915e1c549664fd5f47e8;hp=6051ea1e95555d5a8a90da6b762536550116278b;hpb=7ba6caead509499e353b12ac44a26a9eb7b0eecf;p=modules%2Fsmesh.git diff --git a/src/SMESH_I/SMESH_2smeshpy.cxx b/src/SMESH_I/SMESH_2smeshpy.cxx index 6051ea1e9..929da0dcf 100644 --- a/src/SMESH_I/SMESH_2smeshpy.cxx +++ b/src/SMESH_I/SMESH_2smeshpy.cxx @@ -44,7 +44,7 @@ #include -#ifdef WNT +#ifdef WIN32 #include #else #include @@ -201,6 +201,9 @@ namespace { _AString comment; _pyID obj = cmd->GetObject(); + if ( obj.Search( "print " ) == 1 ) + return; // print statement + if ( !obj.IsEmpty() && obj.Value( obj.Length() ) == ')' ) // remove an accessor method obj = _pyCommand( obj ).GetObject(); @@ -4246,10 +4249,13 @@ bool _pySelfEraser::CanClear() { int nbCalls = 0; std::list< Handle(_pyCommand) >& cmds = GetProcessedCmds(); - std::list< Handle(_pyCommand) >::const_iterator cmd = cmds.begin(); - for ( ; cmd != cmds.end(); ++cmd ) + std::list< Handle(_pyCommand) >::iterator cmd = cmds.begin(); + for ( ; cmd != cmds.end(); ) // check of cmd emptiness is not enough as object can change - nbCalls += ( ( *cmd )->GetString().Search( GetID() ) > 0 ); + if (( *cmd )->GetString().Search( GetID() ) > 0 ) + ++nbCalls, ++cmd; + else + cmd = cmds.erase( cmd ); // save the cmd from clearing toErase = ( nbCalls < 1 ); } @@ -4641,12 +4647,12 @@ void _pyFilter::Process( const Handle(_pyCommand)& theCommand) theCommand->SetMethod( "GetFilterFromCriteria" ); // Swap "aFilterManager.CreateFilter()" and "smesh.GetFilterFromCriteria(criteria)" - // GetCreationCmd()->Clear(); - // GetCreationCmd()->GetString() = theCommand->GetString(); - // theCommand->Clear(); - // theCommand->AddDependantCmd( GetCreationCmd() ); - // why swap? GetCreationCmd()->Clear(); + GetCreationCmd()->GetString() = theCommand->GetString(); + theCommand->Clear(); + theCommand->AddDependantCmd( GetCreationCmd() ); + // why swap? -- it's needed + //GetCreationCmd()->Clear(); } else if ( theCommand->GetMethod() == "SetMesh" ) {