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;
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") );