SetDefaultStyle(wxTextAttr()) now resets the default style instead of not changing it at all

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12817 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2001-12-02 13:29:21 +00:00
parent 2dc5bacc01
commit c598f22518
2 changed files with 11 additions and 2 deletions

View File

@@ -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;
}