From: Vadim Zeitlin Date: Sat, 15 Dec 2007 18:40:15 +0000 (+0000) Subject: fixed another invalid cast X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/f1f7d5ca4bd934a8068b5120dc28983ecf64cd94 fixed another invalid cast git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50730 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- 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;