X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/faa9a600f4ee45757039be01acb0865d1bbae957..bb5b214dabf462aabd35094ffbf217cb060c8a59:/src/gtk1/dcclient.cpp?ds=sidebyside diff --git a/src/gtk1/dcclient.cpp b/src/gtk1/dcclient.cpp index 498f19623a..7046368d6c 100644 --- a/src/gtk1/dcclient.cpp +++ b/src/gtk1/dcclient.cpp @@ -1143,8 +1143,11 @@ bool wxWindowDCImpl::DoBlit( wxCoord xdest, wxCoord ydest, xsrc = source->LogicalToDeviceX(xsrc); ysrc = source->LogicalToDeviceY(ysrc); - wxClientDCImpl *srcDC = (wxClientDCImpl*)source->GetImpl(); - wxMemoryDCImpl *memDC = (wxMemoryDCImpl*)source; + wxWindowDCImpl *srcDC = wxDynamicCast(source->GetImpl(), wxWindowDCImpl); + wxCHECK_MSG( srcDC, false, "source must be a window DC" ); + + // FIXME: this cast is not always valid, see the code using m_isMemDC + wxMemoryDCImpl *memDC = wx_static_cast(wxMemoryDCImpl *, srcDC); bool use_bitmap_method = false; bool is_mono = false;