Refresh shown_text cache when incrementing label name.

Fixes: lp:1828874
* https://bugs.launchpad.net/kicad/+bug/1828874
This commit is contained in:
Jeff Young 2019-05-13 21:57:32 +01:00
parent 2d99ec779f
commit 053c26c96e
2 changed files with 4 additions and 3 deletions

View File

@ -138,6 +138,7 @@ EDA_ITEM* SCH_TEXT::Clone() const
void SCH_TEXT::IncrementLabel( int aIncrement )
{
IncrementLabelMember( m_Text, aIncrement );
m_shown_text = UnescapeString( m_Text );
}

View File

@ -377,6 +377,9 @@ public:
protected:
wxString m_Text;
/// Cache of unescaped text for efficient access
wxString m_shown_text;
// wxString isn't thread-safe, so make use of this in multi-threaded situations
mutable UNIQUE_MUTEX m_mutex;
@ -411,9 +414,6 @@ private:
TE_MULTILINE,
TE_VISIBLE,
};
/// Cache of unescaped text for efficient access
wxString m_shown_text;
};