From: eap Date: Tue, 9 Oct 2012 13:53:34 +0000 (+0000) Subject: 0021891: EDF 2398 : Error when dumping a study with non historical mode X-Git-Tag: V6_6_0a1~53 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c5c930fa65901110f5157ef099891c5a1e0d4dfb;p=modules%2Fsmesh.git 0021891: EDF 2398 : Error when dumping a study with non historical mode Fix bug that AddHypothesis() + RemoveHypothesis() pair was cleared in the historical mode if a hypothesis was removed --- diff --git a/src/SMESH_I/SMESH_2smeshpy.cxx b/src/SMESH_I/SMESH_2smeshpy.cxx index 28bc3cfd4..6734c0d2f 100644 --- a/src/SMESH_I/SMESH_2smeshpy.cxx +++ b/src/SMESH_I/SMESH_2smeshpy.cxx @@ -1563,9 +1563,11 @@ void _pyMesh::Process( const Handle(_pyCommand)& theCommand ) if ( sameHyp ) { addCmd = *cmd; - addCmd->Clear(); - theCommand->Clear(); - cmd = addHypCmds.erase( cmd ); + cmd = addHypCmds.erase( cmd ); + if ( !theGen->IsToKeepAllCommands() ) { + addCmd->Clear(); + theCommand->Clear(); + } } else { @@ -1574,7 +1576,7 @@ void _pyMesh::Process( const Handle(_pyCommand)& theCommand ) } } Handle(_pyHypothesis) hyp = theGen->FindHyp( hypID ); - if ( addCmd.IsNull() && !hypID.IsEmpty() ) { // hypo addition already wrapped + if ( !theCommand->IsEmpty() && !hypID.IsEmpty() ) { // RemoveHypothesis(geom, hyp) --> RemoveHypothesis( hyp, geom=0 ) _pyID geom = theCommand->GetArg( 1 ); theCommand->RemoveArgs();