Add second instance of "don't mess up user formatting" fix.
Fixes https://gitlab.com/kicad/code/kicad/issues/13989
(cherry picked from commit 4b427b2d0c
)
This commit is contained in:
parent
b2241dca72
commit
4aba595b2b
|
@ -111,8 +111,19 @@ bool SIM_STRING_PROPERTY::OnEvent( wxPropertyGrid* propgrid, wxWindow* wnd_prima
|
||||||
wxTextEntry* textEntry = dynamic_cast<wxTextEntry*>( wnd_primary );
|
wxTextEntry* textEntry = dynamic_cast<wxTextEntry*>( wnd_primary );
|
||||||
|
|
||||||
if( textEntry && m_eval.Process( textEntry->GetValue() ) )
|
if( textEntry && m_eval.Process( textEntry->GetValue() ) )
|
||||||
|
{
|
||||||
|
double value = SIM_VALUE::ToDouble( m_eval.Result().ToStdString() );
|
||||||
|
|
||||||
|
if( isnan( value )
|
||||||
|
|| value == SIM_VALUE::ToDouble( textEntry->GetValue().ToStdString() ) )
|
||||||
|
{
|
||||||
|
// Don't mess up user formatting if eval'ing didn't actually change the value.
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
SetValueInEvent( m_eval.Result() );
|
SetValueInEvent( m_eval.Result() );
|
||||||
|
}
|
||||||
|
|
||||||
m_needsEval = false;
|
m_needsEval = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue