don't cache default colours
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27962 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -980,11 +980,10 @@ wxColour wxWindowBase::GetBackgroundColour() const
|
|||||||
if ( !colBg.Ok() )
|
if ( !colBg.Ok() )
|
||||||
colBg = GetClassDefaultAttributes().colBg;
|
colBg = GetClassDefaultAttributes().colBg;
|
||||||
|
|
||||||
// cache it for the next call
|
return colBg;
|
||||||
wxConstCast(this, wxWindowBase)->m_backgroundColour = colBg;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
return m_backgroundColour;
|
return m_backgroundColour;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxColour wxWindowBase::GetForegroundColour() const
|
wxColour wxWindowBase::GetForegroundColour() const
|
||||||
@@ -999,10 +998,10 @@ wxColour wxWindowBase::GetForegroundColour() const
|
|||||||
if ( !colFg.Ok() )
|
if ( !colFg.Ok() )
|
||||||
colFg = GetClassDefaultAttributes().colFg;
|
colFg = GetClassDefaultAttributes().colFg;
|
||||||
|
|
||||||
wxConstCast(this, wxWindowBase)->m_foregroundColour = colFg;
|
return colFg;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
return m_foregroundColour;
|
return m_foregroundColour;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxWindowBase::SetBackgroundColour( const wxColour &colour )
|
bool wxWindowBase::SetBackgroundColour( const wxColour &colour )
|
||||||
@@ -1042,7 +1041,7 @@ bool wxWindowBase::SetCursor(const wxCursor& cursor)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxFont& wxWindowBase::DoGetFont() const
|
wxFont wxWindowBase::GetFont() const
|
||||||
{
|
{
|
||||||
// logic is the same as in GetBackgroundColour()
|
// logic is the same as in GetBackgroundColour()
|
||||||
if ( !m_font.Ok() )
|
if ( !m_font.Ok() )
|
||||||
@@ -1053,11 +1052,10 @@ wxFont& wxWindowBase::DoGetFont() const
|
|||||||
if ( !font.Ok() )
|
if ( !font.Ok() )
|
||||||
font = GetClassDefaultAttributes().font;
|
font = GetClassDefaultAttributes().font;
|
||||||
|
|
||||||
wxConstCast(this, wxWindowBase)->m_font = font;
|
return font;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
// cast is here for non-const GetFont() convenience
|
return m_font;
|
||||||
return wxConstCast(this, wxWindowBase)->m_font;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxWindowBase::SetFont(const wxFont& font)
|
bool wxWindowBase::SetFont(const wxFont& font)
|
||||||
|
Reference in New Issue
Block a user