X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/eda40bfc08b7c15d395316768ea662959b5884b9..4aaef122cbbd5bbe0e70b824e320458e2329dd13:/src/common/textcmn.cpp diff --git a/src/common/textcmn.cpp b/src/common/textcmn.cpp index 7e081b9037..6a494d434c 100644 --- a/src/common/textcmn.cpp +++ b/src/common/textcmn.cpp @@ -115,8 +115,13 @@ bool wxTextCtrlBase::SetStyle(long WXUNUSED(start), long WXUNUSED(end), // change default text attributes bool wxTextCtrlBase::SetDefaultStyle(const wxTextAttr& style) { - // keep the old attributes if the new style doesn't specify them - m_defaultStyle = wxTextAttr::Combine(style, m_defaultStyle, this); + // keep the old attributes if the new style doesn't specify them unless the + // new style is empty - then reset m_defaultStyle (as there is no other way + // to do it) + if ( style.IsDefault() ) + m_defaultStyle = style; + else + m_defaultStyle = wxTextAttr::Combine(style, m_defaultStyle, this); return TRUE; }