X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/10d302224e3555520f3e3c29d4dc7b7a9654b295..5a2c086adf6d7c6bba22fcbd57b0958fdc5723a0:/src/gtk1/dcclient.cpp diff --git a/src/gtk1/dcclient.cpp b/src/gtk1/dcclient.cpp index be87f5dd6d..d3770fda9b 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 = static_cast(srcDC); bool use_bitmap_method = false; bool is_mono = false; @@ -2018,7 +2021,7 @@ void wxWindowDCImpl::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, w gdk_gc_set_clip_region( m_bgGC, m_currentClippingRegion.GetRegion() ); } -void wxWindowDCImpl::DoSetClippingRegionAsRegion( const wxRegion ®ion ) +void wxWindowDCImpl::DoSetDeviceClippingRegion( const wxRegion ®ion ) { wxCHECK_RET( IsOk(), wxT("invalid window dc") );