From 053c26c96e6b8c069628a34769fa05ebfb61176f Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 13 May 2019 21:57:32 +0100 Subject: [PATCH] Refresh shown_text cache when incrementing label name. Fixes: lp:1828874 * https://bugs.launchpad.net/kicad/+bug/1828874 --- eeschema/sch_text.cpp | 1 + include/eda_text.h | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/eeschema/sch_text.cpp b/eeschema/sch_text.cpp index 70d905c6c0..23076cc2c8 100644 --- a/eeschema/sch_text.cpp +++ b/eeschema/sch_text.cpp @@ -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 ); } diff --git a/include/eda_text.h b/include/eda_text.h index a9c22eba06..955cfb8f0d 100644 --- a/include/eda_text.h +++ b/include/eda_text.h @@ -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; };