When presented with empty text we don't want to Normalize() the SIM_VALUE.
But we *do* need to update NUMERICAL_EVALUATOR::m_originalText by calling NUMERICAL_EVALUATOR::Process(). Fixes https://gitlab.com/kicad/code/kicad/-/issues/15871
This commit is contained in:
parent
8cba785375
commit
6b29c346b9
|
@ -194,7 +194,9 @@ bool SIM_STRING_PROPERTY::StringToValue( wxVariant& aVariant, const wxString& aT
|
|||
|
||||
wxString text = aText;
|
||||
|
||||
if( !aText.IsEmpty() && allowEval() && m_needsEval && m_eval.Process( aText ) )
|
||||
if( allowEval() && m_needsEval && m_eval.Process( aText ) )
|
||||
{
|
||||
if( !aText.IsEmpty() )
|
||||
{
|
||||
double value = SIM_VALUE::ToDouble( m_eval.Result().ToStdString() );
|
||||
|
||||
|
@ -207,6 +209,7 @@ bool SIM_STRING_PROPERTY::StringToValue( wxVariant& aVariant, const wxString& aT
|
|||
text = SIM_VALUE::Normalize( value );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_model.SetParamValue( m_paramIndex, text.ToStdString() );
|
||||
aVariant = text.ToStdString();
|
||||
|
|
Loading…
Reference in New Issue