mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-29 10:25:27 +08:00
Allow to check if wxMarkupText has changed when setting it
This can/will be used for avoidiing to do anything if the markup hasn't really changed.
This commit is contained in:
@@ -27,8 +27,16 @@ class WXDLLIMPEXP_CORE wxMarkupTextBase
|
||||
public:
|
||||
virtual ~wxMarkupTextBase() = default;
|
||||
|
||||
// Update the markup string.
|
||||
void SetMarkup(const wxString& markup) { m_markup = markup; }
|
||||
// Update the markup string, return false if it didn't change.
|
||||
bool SetMarkup(const wxString& markup)
|
||||
{
|
||||
if ( markup == m_markup )
|
||||
return false;
|
||||
|
||||
m_markup = markup;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Return the width and height required by the given string and optionally
|
||||
// the height of the visible part above the baseline (i.e. ascent minus
|
||||
|
||||
Reference in New Issue
Block a user