Improve robustness of numeric evaluation.

It would appear that some platforms process the KILL_FOCUS event
after running TransferDataFromWindow().  This change makes sure
that the evaluation is done no matter the order.

Fixes: lp:1793911
* https://bugs.launchpad.net/kicad/+bug/1793911
This commit is contained in:
Jeff Young
2018-10-08 12:59:40 +01:00
parent 90df7a8b22
commit 3024ded91e
4 changed files with 54 additions and 59 deletions
-3
View File
@@ -76,9 +76,6 @@ void TEXT_CTRL_EVAL::onTextEnter( wxCommandEvent& aEvent )
void TEXT_CTRL_EVAL::evaluate()
{
if( GetValue().IsEmpty() )
wxTextCtrl::SetValue( "0" );
if( m_eval.Process( GetValue() ) )
SetValue( m_eval.Result() );
}