X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/10d302224e3555520f3e3c29d4dc7b7a9654b295..e976429dfade9fe445d1d5abf630e9458d51abbe:/src/gtk1/dcclient.cpp diff --git a/src/gtk1/dcclient.cpp b/src/gtk1/dcclient.cpp index be87f5dd6d..7046368d6c 100644 --- a/src/gtk1/dcclient.cpp +++ b/src/gtk1/dcclient.cpp @@ -444,7 +444,7 @@ bool wxWindowDCImpl::DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const wxMemoryDC memdc; wxBitmap bitmap(1, 1); memdc.SelectObject(bitmap); - memdc.Blit(0, 0, 1, 1, (wxDC*) this, x1, y1); + memdc.Blit(0, 0, 1, 1, GetOwner(), x1, y1); memdc.SelectObject(wxNullBitmap); wxImage image = bitmap.ConvertToImage(); @@ -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;