Save original_text before obliterating it.
Fixes: lp:1793911 * https://bugs.launchpad.net/kicad/+bug/1793911
This commit is contained in:
parent
af8715da80
commit
d1a679e496
|
@ -129,8 +129,6 @@ wxString NUMERIC_EVALUATOR::OriginalText() const
|
||||||
|
|
||||||
bool NUMERIC_EVALUATOR::Process( const wxString& aString )
|
bool NUMERIC_EVALUATOR::Process( const wxString& aString )
|
||||||
{
|
{
|
||||||
m_originalText = aString;
|
|
||||||
|
|
||||||
// Feed parser token after token until end of input.
|
// Feed parser token after token until end of input.
|
||||||
|
|
||||||
newString( aString );
|
newString( aString );
|
||||||
|
@ -158,12 +156,15 @@ bool NUMERIC_EVALUATOR::Process( const wxString& aString )
|
||||||
void NUMERIC_EVALUATOR::newString( const wxString& aString )
|
void NUMERIC_EVALUATOR::newString( const wxString& aString )
|
||||||
{
|
{
|
||||||
Clear();
|
Clear();
|
||||||
auto len = aString.length();
|
|
||||||
m_token.token = reinterpret_cast<decltype( m_token.token )>( malloc( TokenStat::OutLen + 1 ));
|
m_originalText = aString;
|
||||||
|
|
||||||
|
m_token.token = reinterpret_cast<decltype( m_token.token )>( malloc( TokenStat::OutLen + 1 ) );
|
||||||
strcpy( m_token.token, "0" );
|
strcpy( m_token.token, "0" );
|
||||||
m_token.inputLen = len;
|
m_token.inputLen = aString.length();
|
||||||
m_token.pos = 0;
|
m_token.pos = 0;
|
||||||
m_token.input = aString.mb_str();
|
m_token.input = aString.mb_str();
|
||||||
|
|
||||||
m_parseFinished = false;
|
m_parseFinished = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue