Fix bug that AddHypothesis() + RemoveHypothesis() pair was cleared in
the historical mode if a hypothesis was removed
if ( sameHyp )
{
addCmd = *cmd;
- addCmd->Clear();
- theCommand->Clear();
- cmd = addHypCmds.erase( cmd );
+ cmd = addHypCmds.erase( cmd );
+ if ( !theGen->IsToKeepAllCommands() ) {
+ addCmd->Clear();
+ theCommand->Clear();
+ }
}
else
{
}
}
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();