X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/87f83ac8676d83b1bc75cbb0a6b4cf612f86bc2b..c77eea28f955e9c5e59d952594ccc5e96de1597e:/src/mgl/dc.cpp diff --git a/src/mgl/dc.cpp b/src/mgl/dc.cpp index b3f098fa7c..8eabf06310 100644 --- a/src/mgl/dc.cpp +++ b/src/mgl/dc.cpp @@ -1091,15 +1091,16 @@ void wxDC::SetPalette(const wxPalette& palette) { wxCHECK_RET( Ok(), wxT("invalid dc") ); - if ( palette == wxNullPalette ) + if ( !palette.Ok() ) { if ( m_oldPalette.Ok() ) SetPalette(m_oldPalette); return; } - if ( !palette.Ok() ) return; - if ( m_palette == palette ) return; + if ( palette.IsSameAs(m_palette) ) + return; + m_oldPalette = m_palette; m_palette = palette;