diff --git a/common/libeval/numeric_evaluator.cpp b/common/libeval/numeric_evaluator.cpp index 812ca031ab..a09ddb18cc 100644 --- a/common/libeval/numeric_evaluator.cpp +++ b/common/libeval/numeric_evaluator.cpp @@ -129,8 +129,6 @@ wxString NUMERIC_EVALUATOR::OriginalText() const bool NUMERIC_EVALUATOR::Process( const wxString& aString ) { - m_originalText = aString; - // Feed parser token after token until end of input. newString( aString ); @@ -158,12 +156,15 @@ bool NUMERIC_EVALUATOR::Process( const wxString& aString ) void NUMERIC_EVALUATOR::newString( const wxString& aString ) { Clear(); - auto len = aString.length(); - m_token.token = reinterpret_cast( malloc( TokenStat::OutLen + 1 )); + + m_originalText = aString; + + m_token.token = reinterpret_cast( malloc( TokenStat::OutLen + 1 ) ); strcpy( m_token.token, "0" ); - m_token.inputLen = len; + m_token.inputLen = aString.length(); m_token.pos = 0; m_token.input = aString.mb_str(); + m_parseFinished = false; }