Cache unescaped text to boost connectivity performance
This commit is contained in:
parent
ed27c50692
commit
3bfe5fb84b
|
@ -52,6 +52,13 @@ EDA_TEXT::~EDA_TEXT()
|
|||
}
|
||||
|
||||
|
||||
void EDA_TEXT::SetText( const wxString& aText )
|
||||
{
|
||||
m_Text = aText;
|
||||
m_shown_text = UnescapeString( aText );
|
||||
}
|
||||
|
||||
|
||||
void EDA_TEXT::SetEffects( const EDA_TEXT& aSrc )
|
||||
{
|
||||
m_e = aSrc.m_e;
|
||||
|
|
|
@ -150,13 +150,13 @@ public:
|
|||
/**
|
||||
* Returns the string actually shown after processing of the base
|
||||
* text. Default is no processing */
|
||||
virtual wxString GetShownText() const { return UnescapeString( m_Text ); }
|
||||
virtual wxString GetShownText() const { return m_shown_text; }
|
||||
|
||||
/**
|
||||
* Returns a shortened version (max 15 characters) of the shown text */
|
||||
wxString ShortenedShownText() const;
|
||||
|
||||
virtual void SetText( const wxString& aText ) { m_Text = aText; }
|
||||
virtual void SetText( const wxString& aText );
|
||||
|
||||
/**
|
||||
* Function SetThickness
|
||||
|
@ -412,6 +412,9 @@ private:
|
|||
TE_MULTILINE,
|
||||
TE_VISIBLE,
|
||||
};
|
||||
|
||||
/// Cache of unescaped text for efficient access
|
||||
wxString m_shown_text;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue