avoiding potential mismatch between true and expected state of wxGraphicsContext because it might have been changed through its direct API meanwhile, fixes #14226

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71214 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2012-04-17 16:57:12 +00:00
parent d60a9c00e4
commit 38274d1de3

View File

@@ -385,7 +385,7 @@ void wxGCDCImpl::SetTextForeground( const wxColour &col )
// don't set m_textForegroundColour to an invalid colour as we'd crash // don't set m_textForegroundColour to an invalid colour as we'd crash
// later then (we use m_textForegroundColour.GetColor() without checking // later then (we use m_textForegroundColour.GetColor() without checking
// in a few places) // in a few places)
if ( col.IsOk() && col != m_textForegroundColour ) if ( col.IsOk() )
{ {
m_textForegroundColour = col; m_textForegroundColour = col;
m_graphicContext->SetFont( m_font, m_textForegroundColour ); m_graphicContext->SetFont( m_font, m_textForegroundColour );
@@ -481,9 +481,6 @@ void wxGCDCImpl::SetFont( const wxFont &font )
void wxGCDCImpl::SetPen( const wxPen &pen ) void wxGCDCImpl::SetPen( const wxPen &pen )
{ {
if ( m_pen == pen )
return;
m_pen = pen; m_pen = pen;
if ( m_graphicContext ) if ( m_graphicContext )
{ {
@@ -493,9 +490,6 @@ void wxGCDCImpl::SetPen( const wxPen &pen )
void wxGCDCImpl::SetBrush( const wxBrush &brush ) void wxGCDCImpl::SetBrush( const wxBrush &brush )
{ {
if (m_brush == brush)
return;
m_brush = brush; m_brush = brush;
if ( m_graphicContext ) if ( m_graphicContext )
{ {
@@ -505,9 +499,6 @@ void wxGCDCImpl::SetBrush( const wxBrush &brush )
void wxGCDCImpl::SetBackground( const wxBrush &brush ) void wxGCDCImpl::SetBackground( const wxBrush &brush )
{ {
if (m_backgroundBrush == brush)
return;
m_backgroundBrush = brush; m_backgroundBrush = brush;
if (!m_backgroundBrush.IsOk()) if (!m_backgroundBrush.IsOk())
return; return;
@@ -515,9 +506,6 @@ void wxGCDCImpl::SetBackground( const wxBrush &brush )
void wxGCDCImpl::SetLogicalFunction( wxRasterOperationMode function ) void wxGCDCImpl::SetLogicalFunction( wxRasterOperationMode function )
{ {
if (m_logicalFunction == function)
return;
m_logicalFunction = function; m_logicalFunction = function;
wxCompositionMode mode = TranslateRasterOp( function ); wxCompositionMode mode = TranslateRasterOp( function );